refactor(google-tasks/find-task): filter all tasks when finding a task
This commit is contained in:
@@ -3,7 +3,7 @@ import defineAction from '../../../../helpers/define-action.js';
|
|||||||
export default defineAction({
|
export default defineAction({
|
||||||
name: 'Find task',
|
name: 'Find task',
|
||||||
key: 'findTask',
|
key: 'findTask',
|
||||||
description: 'Looking for an incomplete task.',
|
description: 'Looking for a specific task.',
|
||||||
arguments: [
|
arguments: [
|
||||||
{
|
{
|
||||||
label: 'Task List',
|
label: 'Task List',
|
||||||
@@ -37,7 +37,14 @@ export default defineAction({
|
|||||||
const taskListId = $.step.parameters.taskListId;
|
const taskListId = $.step.parameters.taskListId;
|
||||||
const title = $.step.parameters.title;
|
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) =>
|
const filteredTask = data.items?.filter((task) =>
|
||||||
task.title.includes(title)
|
task.title.includes(title)
|
||||||
|
@@ -6,7 +6,7 @@ items:
|
|||||||
- name: Create task list
|
- name: Create task list
|
||||||
desc: Creates a new task list.
|
desc: Creates a new task list.
|
||||||
- name: Find task
|
- name: Find task
|
||||||
desc: Looking for an incomplete task.
|
desc: Looking for a specific task.
|
||||||
- name: Update task
|
- name: Update task
|
||||||
desc: Updates an existing task.
|
desc: Updates an existing task.
|
||||||
---
|
---
|
||||||
|
Reference in New Issue
Block a user