Skip to content

Commit

Permalink
feat : create delete party api #13
Browse files Browse the repository at this point in the history
  • Loading branch information
LWJ0513 committed Mar 18, 2023
1 parent 6381de4 commit d2bdde0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,10 @@ public PartyResponseDTO editParty(@PathVariable Long id, @RequestBody PartyEditR

return partyService.editParty(id, partyEditRequestDTO);
}

@DeleteMapping("/party/{id}/delete")
public PartyResponseDTO deleteParty(@PathVariable Long id) {

return partyService.deleteParty(id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ public PartyResponseDTO editParty(Long id, PartyEditRequestDTO partyEditRequestD
return new PartyResponseDTO(id);
}

public PartyResponseDTO deleteParty(Long id) {
partyRepository.deleteById(id);

return new PartyResponseDTO(id);
}

private PartyInfoDTO convertEntityToPartyInfoDTO(Party party) {

return PartyInfoDTO.builder()
Expand Down

0 comments on commit d2bdde0

Please sign in to comment.