28 lines
847 B
TypeScript
28 lines
847 B
TypeScript
import express from "express";
|
|
import {
|
|
Controller,
|
|
Get,
|
|
Request,
|
|
Route,
|
|
Security,
|
|
SuccessResponse,
|
|
} from "tsoa";
|
|
import type { FoundEventDto } from "../dtos/foundEvents.js";
|
|
import { inject } from "../infrastructure/di/index.js";
|
|
import { FoundEventsService } from "../services/foundEvents/foundEventsService.js";
|
|
import { KC_SECURITY_NAME } from "../services/keycloak/user/keycloak-user.js";
|
|
|
|
@Route("found-events")
|
|
export class FoundEventsController extends Controller {
|
|
private readonly foundEventsService = inject(FoundEventsService);
|
|
|
|
@Get("future")
|
|
@Security(KC_SECURITY_NAME)
|
|
@SuccessResponse("200", "OK")
|
|
public async getFutureEvents(
|
|
@Request() request: express.Request,
|
|
): Promise<FoundEventDto[]> {
|
|
return await this.foundEventsService.getFutureEvents(request);
|
|
}
|
|
}
|