From ebd7ab11cbb5ff7dc6eacfd50e6d72e49eb85afd Mon Sep 17 00:00:00 2001 From: Ehab Younes Date: Fri, 13 Feb 2026 19:11:46 +0300 Subject: [PATCH] feat(site): add missing Tasks API client methods (#22079) Add getTaskLogs, pauseTask, resumeTask, and sendTaskInput methods to the API client to cover remaining Tasks API endpoints. --- site/src/api/api.ts | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/site/src/api/api.ts b/site/src/api/api.ts index d1d7ba4795..203ba1855a 100644 --- a/site/src/api/api.ts +++ b/site/src/api/api.ts @@ -2787,6 +2787,46 @@ class ApiMethods { } satisfies TypesGen.UpdateTaskInputRequest); }; + getTaskLogs = async ( + user: string, + id: string, + ): Promise => { + const response = await this.axios.get( + `/api/v2/tasks/${user}/${id}/logs`, + ); + return response.data; + }; + + pauseTask = async ( + user: string, + id: string, + ): Promise => { + const response = await this.axios.post( + `/api/v2/tasks/${user}/${id}/pause`, + ); + return response.data; + }; + + resumeTask = async ( + user: string, + id: string, + ): Promise => { + const response = await this.axios.post( + `/api/v2/tasks/${user}/${id}/resume`, + ); + return response.data; + }; + + sendTaskInput = async ( + user: string, + id: string, + input: string, + ): Promise => { + await this.axios.post(`/api/v2/tasks/${user}/${id}/send`, { + input, + } satisfies TypesGen.TaskSendRequest); + }; + createTaskFeedback = async ( _taskId: string, _req: CreateTaskFeedbackRequest,