Add delete link functionality in frontend

This commit is contained in:
2025-12-24 14:02:36 +00:00
parent c56ea8b90f
commit 52d1984478
6 changed files with 171 additions and 44 deletions

View File

@@ -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);