Skip to content

Commit

Permalink
feat: getEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
w8385 committed May 25, 2024
1 parent f713a8d commit 55dc004
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/group/group.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
7 changes: 7 additions & 0 deletions src/group/group.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 55dc004

Please sign in to comment.