Skip to content

Commit b37ac8e

Browse files
authored
Merge pull request #198 from game-node-app/dev
Make awards endpoints public
2 parents 661bffd + d5f7cf0 commit b37ac8e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/awards/awards.controller.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Controller, Get, Param, UseGuards } from "@nestjs/common";
22
import { AuthGuard } from "../auth/auth.guard";
33
import { ApiTags } from "@nestjs/swagger";
44
import { AwardsService } from "./awards.service";
5+
import { Public } from "../auth/public.decorator";
56

67
@Controller("awards")
78
@UseGuards(AuthGuard)
@@ -10,21 +11,25 @@ export class AwardsController {
1011
constructor(private readonly awardsService: AwardsService) {}
1112

1213
@Get("events/:id")
14+
@Public()
1315
public async getEventById(@Param("id") id: number) {
1416
return this.awardsService.getEventByIdOrFail(id);
1517
}
1618

19+
@Public()
1720
@Get("events/year/:year")
1821
public async getEventsByYear(@Param("year") year: number) {
1922
return this.awardsService.getEventByYearOrFail(year);
2023
}
2124

2225
@Get("events")
26+
@Public()
2327
public async getEvents() {
2428
return this.awardsService.getEvents();
2529
}
2630

2731
@Get(":eventId/categories")
32+
@Public()
2833
public async getCategoriesByEventId(@Param("eventId") eventId: number) {
2934
return this.awardsService.getCategoriesByEventId(eventId);
3035
}

0 commit comments

Comments
 (0)