Skip to content

Commit

Permalink
#520 [feat] 관리자페이지 모임 삭제 인가체제 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
parkheeddong committed Oct 6, 2024
1 parent 8f65437 commit 76def44
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,12 @@ public SuccessResponse<MoimPublicStatusResponse> getPublicStatusOfMoim(

@Override
@DeleteMapping("/{moimId}")
@UserAuthAnnotation(UserAuthenticationType.OWNER)
public ResponseEntity<SuccessResponse> deleteMoim(
@MoimIdPathVariable final Long moimId,
@UserId final Long userId,
@PathVariable("moimId") final String moimUrl
) {
moimService.deleteMoim(moimId, userId);
moimService.deleteMoim(moimId);
return ResponseEntity.ok(SuccessResponse.of(SuccessMessage.MOIM_DELETE_SUCCESS));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ SuccessResponse getPublicStatusOfMoim(
)
ResponseEntity<SuccessResponse> deleteMoim(
@Parameter(schema = @Schema(implementation = String.class), in = ParameterIn.PATH) final Long moimId,
@Parameter(schema = @Schema(implementation = String.class), in = ParameterIn.PATH) @UserId final Long userId,
@PathVariable("moimId") final String moimUrl
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,9 @@ public MoimPublicStatusResponse getPublicStatusOfMoim(
}

public void deleteMoim(
final Long moimId,
final Long userId
final Long moimId
) {

Moim moim = moimRetriever.findById(moimId);
moimRetriever.authenticateOwnerOfMoim(moim, userRetriever.findById(userId));
moimRemover.deleteRelatedData(moim);
writerNameRemover.deleteWriterNamesByMoim(moim);
topicRemover.deleteTopicsByMoim(moim);
Expand Down

0 comments on commit 76def44

Please sign in to comment.