(req: HTTPRequestLike, res: HTTPResponseLike)
| 483 | |
| 484 | @Get("/api/stats") |
| 485 | async getStats(req: HTTPRequestLike, res: HTTPResponseLike): Promise<void> { |
| 486 | try { |
| 487 | const allTasks = await this.cacheManager.getAllTasks(); |
| 488 | const fullStats = this.taskStatsService.getStats(allTasks); |
| 489 | |
| 490 | const stats = { |
| 491 | total: fullStats.total, |
| 492 | completed: fullStats.completed, |
| 493 | active: fullStats.active, |
| 494 | overdue: fullStats.overdue, |
| 495 | archived: fullStats.archived, |
| 496 | withTimeTracking: fullStats.withTimeEntries, |
| 497 | }; |
| 498 | |
| 499 | this.sendResponse(res, 200, this.successResponse(stats)); |
| 500 | } catch (error: unknown) { |
| 501 | this.sendResponse(res, 500, this.errorResponse(this.getErrorMessage(error))); |
| 502 | } |
| 503 | } |
| 504 | } |
no test coverage detected