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

Method pausePomodoro

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

Source from the content-addressed store, hash-verified

99
100 @Post("/api/pomodoro/pause")
101 async pausePomodoro(req: HTTPRequestLike, res: HTTPResponseLike): Promise<void> {
102 try {
103 const currentState = this.plugin.pomodoroService.getState();
104 if (!currentState.isRunning || !currentState.currentSession) {
105 this.sendResponse(
106 res,
107 400,
108 this.errorResponse("No running pomodoro session to pause")
109 );
110 return;
111 }
112
113 await this.plugin.pomodoroService.pausePomodoro();
114
115 const newState = this.plugin.pomodoroService.getState();
116
117 this.sendResponse(
118 res,
119 200,
120 this.successResponse({
121 timeRemaining: newState.timeRemaining,
122 message: "Pomodoro session paused",
123 })
124 );
125 } catch (error: unknown) {
126 this.sendResponse(res, 400, this.errorResponse(this.getErrorMessage(error)));
127 }
128 }
129
130 @Post("/api/pomodoro/resume")
131 async resumePomodoro(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