( req: HTTPRequestLike, res: HTTPResponseLike, params?: Record<string, string> )
| 164 | |
| 165 | @Get("/api/tasks/:id") |
| 166 | async getTask( |
| 167 | req: HTTPRequestLike, |
| 168 | res: HTTPResponseLike, |
| 169 | params?: Record<string, string> |
| 170 | ): Promise<void> { |
| 171 | try { |
| 172 | const taskId = params?.id; |
| 173 | if (!taskId) { |
| 174 | this.sendResponse(res, 400, this.errorResponse("Task ID is required")); |
| 175 | return; |
| 176 | } |
| 177 | |
| 178 | const task = await this.cacheManager.getTaskInfo(taskId); |
| 179 | |
| 180 | if (!task) { |
| 181 | this.sendResponse(res, 404, this.errorResponse("Task not found")); |
| 182 | return; |
| 183 | } |
| 184 | |
| 185 | const taskWithDetails = await hydrateTaskDetailsFromFile(this.plugin.app, task); |
| 186 | |
| 187 | this.sendResponse(res, 200, this.successResponse(taskWithDetails)); |
| 188 | } catch (error: unknown) { |
| 189 | this.sendResponse(res, 500, this.errorResponse(this.getErrorMessage(error))); |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | @Put("/api/tasks/:id") |
| 194 | async updateTask( |
nothing calls this directly
no test coverage detected