MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / getTask

Method getTask

src/api/TasksController.ts:166–191  ·  view source on GitHub ↗
(
		req: HTTPRequestLike,
		res: HTTPResponseLike,
		params?: Record<string, string>
	)

Source from the content-addressed store, hash-verified

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(

Callers

nothing calls this directly

Calls 6

sendResponseMethod · 0.80
errorResponseMethod · 0.80
successResponseMethod · 0.80
getTaskInfoMethod · 0.65
getErrorMessageMethod · 0.45

Tested by

no test coverage detected