File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed
kotlin/com/wafflestudio/spring2025/domain/registration Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -52,20 +52,18 @@ class EventRegistrationController(
5252 @GetMapping
5353 fun list (
5454 @PathVariable eventId : String ,
55- @LoggedInUser user : User ,
55+ @LoggedInUser user : User ? ,
5656 @RequestParam(required = false ) status : String? ,
5757 @RequestParam(required = false ) orderBy : String? ,
5858 @RequestParam(required = false ) cursor : Int? ,
59- ): ResponseEntity <GetEventRegistrationsResponse > {
60- val userId = requireNotNull(user.id) { " 로그인 사용자 ID가 없습니다." }
61- return ResponseEntity .ok(
59+ ): ResponseEntity <GetEventRegistrationsResponse > =
60+ ResponseEntity .ok(
6261 registrationService.getEventRegistration(
6362 eventId = eventId,
64- requesterId = userId ,
63+ requesterId = user?.id ,
6564 status = status,
6665 orderBy = orderBy,
6766 cursor = cursor,
6867 ),
6968 )
70- }
7169}
Original file line number Diff line number Diff line change @@ -361,14 +361,14 @@ class RegistrationService(
361361
362362 fun getEventRegistration (
363363 eventId : String ,
364- requesterId : Long ,
364+ requesterId : Long? ,
365365 status : String? ,
366366 orderBy : String? ,
367367 cursor : Int? ,
368368 ): GetEventRegistrationsResponse {
369369 val event = eventRepository.findByPublicId(eventId) ? : throw EventNotFoundException ()
370370 val eventPk = event.id ? : throw EventNotFoundException ()
371- val isAdmin = event.createdBy == requesterId
371+ val isAdmin = requesterId != null && event.createdBy == requesterId
372372
373373 val statusFilter = parseStatusFilter(status)
374374 val order = parseOrderBy(orderBy)
Original file line number Diff line number Diff line change 1+ ALTER TABLE registrations
2+ MODIFY status ENUM(
3+ ' HOST' ,
4+ ' CONFIRMED' ,
5+ ' WAITLISTED' ,
6+ ' CANCELED' ,
7+ ' BANNED'
8+ ) NOT NULL ;
You can’t perform that action at this time.
0 commit comments