Event Controller

In this lesson, we'll implement a REST endpoint to update events.

Understanding the Update Event Endpoint

The update event endpoint uses HTTP PUT to support full updates of event resources. Let's look at how we implement this endpoint in our event controller:

@PutMapping(path = "/{eventId}") public ResponseEntity<UpdateEventResponseDto> updateEvent( @AuthenticationPrincipal Jwt jwt, @PathVariable UUID eventId, @Valid @RequestBody UpdateEventRequestDto updateEventRequestDto){ UpdateEventRequest updateEventRequest = eventMapper.fromDto(updateEventRequestDto); UUID userId = parseUserId(jwt); Event updatedEvent = eventService.updateEventForOrganizer( userId, eventId, updateEventRequest ); UpdateEventResponseDto updateEventResponseDto = eventMapper.toUpdateEventResponseDto(updatedEvent); return ResponseEntity.ok(updateEventResponseDto); }

Summary

  • Implemented the update event endpoint on the EventController
© 2026 Devtiro Ltd. All rights reserved