Skip to content

Commit

Permalink
more secure
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Gorzala committed Dec 21, 2023
1 parent 302434d commit 7cbf05a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/net/dancier/dancer/chat/ChatController.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,14 @@ public ResponseEntity postMessage(
return new ResponseEntity(HttpStatus.CREATED);
}

@PutMapping("/messages/{messageId}/read-by/{participantId}")
@PutMapping("/messages/{messageId}")
@Secured(ROLE_USER)
public ResponseEntity putReadFlag(
@CurrentUser AuthenticatedUser authenticatedUser,
@PathVariable UUID messageId,
@PathVariable UUID participantId,
@RequestBody SetReadFlagRequestDto setReadFlagRequestDto
) {
chatService.setReadFlag(messageId, participantId, setReadFlagRequestDto.getRead());
chatService.setReadFlag(messageId, authenticatedUser.getDancerIdOrThrow(), setReadFlagRequestDto.getRead());
return new ResponseEntity(HttpStatus.NO_CONTENT);
}

Expand Down

0 comments on commit 7cbf05a

Please sign in to comment.