mirror of
https://github.com/0xShay/halflink.git
synced 2026-01-11 13:13:25 +00:00
Add delete link functionality in frontend
This commit is contained in:
@@ -40,6 +40,15 @@ public class ShortLinkController {
|
||||
return savedShortLink;
|
||||
}
|
||||
|
||||
@GetMapping("/info/{id}")
|
||||
public ResponseEntity<ShortLink> getShortLink(@PathVariable UUID id) {
|
||||
ShortLink sl = shortLinkRepository.findById(id).orElse(null);
|
||||
if (sl == null) {
|
||||
return ResponseEntity.notFound().build();
|
||||
}
|
||||
return ResponseEntity.ok(sl);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public void deleteShortLink(@PathVariable UUID id) {
|
||||
shortLinkRepository.deleteById(id);
|
||||
|
||||
Reference in New Issue
Block a user