MCPcopy
hub / github.com/callumalpass/tasknotes / stopPomodoro

Method stopPomodoro

src/api/PomodoroController.ts:74–98  ·  view source on GitHub ↗
(req: HTTPRequestLike, res: HTTPResponseLike)

Source from the content-addressed store, hash-verified

72
73 @Post("/api/pomodoro/stop")
74 async stopPomodoro(req: HTTPRequestLike, res: HTTPResponseLike): Promise<void> {
75 try {
76 const currentState = this.plugin.pomodoroService.getState();
77 if (!currentState.currentSession) {
78 this.sendResponse(
79 res,
80 400,
81 this.errorResponse("No active pomodoro session to stop")
82 );
83 return;
84 }
85
86 await this.plugin.pomodoroService.stopPomodoro();
87
88 this.sendResponse(
89 res,
90 200,
91 this.successResponse({
92 message: "Pomodoro session stopped and reset",
93 })
94 );
95 } catch (error: unknown) {
96 this.sendResponse(res, 400, this.errorResponse(this.getErrorMessage(error)));
97 }
98 }
99
100 @Post("/api/pomodoro/pause")
101 async pausePomodoro(req: HTTPRequestLike, res: HTTPResponseLike): Promise<void> {

Callers

nothing calls this directly

Calls 5

sendResponseMethod · 0.80
errorResponseMethod · 0.80
successResponseMethod · 0.80
getStateMethod · 0.45
getErrorMessageMethod · 0.45

Tested by

no test coverage detected