Skip to content

Commit 4aebce3

Browse files
committed
fixes
1 parent 404ab20 commit 4aebce3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

js/botasaurus-desktop-api/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,14 @@ const api = new Api({ apiUrl: 'https://example.com' })`);
291291
}
292292
}
293293

294-
async getTasks({ page = 1, perPage, withResults = true }: { page?: number; perPage?: number; withResults?: boolean } = { page: 1, withResults: true }): Promise<PaginatedResponse<Task>> {
294+
async getTasks({ page = 1, perPage, withResults = true, parentTaskId }: { page?: number; perPage?: number; withResults?: boolean; parentTaskId?: number } = { page: 1, withResults: true }): Promise<PaginatedResponse<Task>> {
295295
/**
296296
* Fetches tasks from the server, with optional result inclusion, pagination, and filtering.
297297
*
298298
* @param page The page number for pagination.
299299
* @param perPage The number of tasks to return per page.
300300
* @param withResults Whether to include the task results in the response.
301+
* @param parentTaskId Filter tasks by parent task ID.
301302
* @return A dictionary containing the task results and pagination information.
302303
*/
303304
const url = this._makeApiUrl("tasks");
@@ -306,6 +307,7 @@ const api = new Api({ apiUrl: 'https://example.com' })`);
306307
};
307308
if (page !== undefined && page !== null) params.page = page;
308309
if (perPage !== undefined && perPage !== null) params.per_page = perPage;
310+
if (parentTaskId !== undefined && parentTaskId !== null) params.parent_task_id = parentTaskId;
309311
try {
310312
const response = await axios.get(url, { params });
311313

0 commit comments

Comments
 (0)