implemented deletion of notice

This commit is contained in:
2025-04-14 10:08:26 +02:00
parent b0f47b475a
commit f17b97eaf9
2 changed files with 21 additions and 0 deletions

View File

@@ -82,6 +82,17 @@ public ResponseEntity<Object> editNotice(@PathVariable("id") long id, @RequestBo
}
}
@DeleteMapping("/delete/{id}")
public ResponseEntity deleteNotice(@PathVariable("id") long id) {
if(noticeService.noticeExists(id)) {
noticeService.deleteNotice(id);
return new ResponseEntity<>(HttpStatus.OK);
} else {
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
}
// @GetMapping("/check/{id}")
// public ResponseEntity<String> checkNotice(@PathVariable("id") long id) {
// if (noticeService.noticeExists(id)) {