refactor(google-tasks/find-task): filter all tasks when finding a task

This commit is contained in:
Rıdvan Akca
2024-05-07 16:51:23 +02:00
parent 033b15a158
commit 7b4179a87f
2 changed files with 10 additions and 3 deletions

View File

@@ -3,7 +3,7 @@ import defineAction from '../../../../helpers/define-action.js';
export default defineAction({
name: 'Find task',
key: 'findTask',
description: 'Looking for an incomplete task.',
description: 'Looking for a specific task.',
arguments: [
{
label: 'Task List',
@@ -37,7 +37,14 @@ export default defineAction({
const taskListId = $.step.parameters.taskListId;
const title = $.step.parameters.title;
const { data } = await $.http.get(`/tasks/v1/lists/${taskListId}/tasks`);
const params = {
showCompleted: true,
showHidden: true,
};
const { data } = await $.http.get(`/tasks/v1/lists/${taskListId}/tasks`, {
params,
});
const filteredTask = data.items?.filter((task) =>
task.title.includes(title)

View File

@@ -6,7 +6,7 @@ items:
- name: Create task list
desc: Creates a new task list.
- name: Find task
desc: Looking for an incomplete task.
desc: Looking for a specific task.
- name: Update task
desc: Updates an existing task.
---