(req: HTTPRequestLike, res: HTTPResponseLike)
| 86 | |
| 87 | @Get("/api/calendars/events") |
| 88 | async getEvents(req: HTTPRequestLike, res: HTTPResponseLike): Promise<void> { |
| 89 | try { |
| 90 | const params = parseRequestUrl(req).searchParams; |
| 91 | |
| 92 | const start = params.get("start"); |
| 93 | const end = params.get("end"); |
| 94 | const startDate = start ? new Date(start) : null; |
| 95 | const endDate = end ? new Date(end) : null; |
| 96 | |
| 97 | const result = collectCalendarEvents( |
| 98 | this.calendarProviderRegistry, |
| 99 | this.icsSubscriptionService, |
| 100 | { start: startDate, end: endDate } |
| 101 | ); |
| 102 | |
| 103 | this.sendResponse(res, 200, this.successResponse(result)); |
| 104 | } catch (error: unknown) { |
| 105 | this.sendResponse(res, 500, this.errorResponse(this.getErrorMessage(error))); |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | private async getProvidersOverview(): Promise<unknown[]> { |
| 110 | const providers: unknown[] = []; |
nothing calls this directly
no test coverage detected