diff --git a/src/group/group.controller.ts b/src/group/group.controller.ts index bc2b86b..92e804b 100644 --- a/src/group/group.controller.ts +++ b/src/group/group.controller.ts @@ -184,8 +184,8 @@ export class GroupController { summary: '모임 이벤트 상세 조회', description: '특정 모임의 특정 이벤트를 조회합니다.', }) - getEvent(@Param('groupId') groupId: string, @Param('eventId') eventId: string) { - return this.groupService.getEvents(groupId, eventId); + getEvent(@Req() req: any, @Param('groupId') groupId: string, @Param('eventId') eventId: string) { + return this.groupService.getEvent(req.userId, groupId, eventId); } @Get(':groupId/transaction') diff --git a/src/group/group.service.ts b/src/group/group.service.ts index 813f108..4a61e51 100644 --- a/src/group/group.service.ts +++ b/src/group/group.service.ts @@ -151,6 +151,13 @@ export class GroupService { return await this.getAllEvents(group.events); } + async getEvent(userId: string, groupId: string, eventId: string) { + const group = await this.groupRepository.findOne(groupId); + this.groupValidator.validateGroupViewer(group, userId); + + return this.eventService.getOne(eventId); + } + async getTransactions(userId: string, groupId: string) { const group = await this.groupRepository.findOne(groupId); this.groupValidator.validateGroupViewer(group, userId);