fix: prevent deleting registry entries that would create sequence gaps
Only the last entry in a company+year sequence can be deleted. Trying to delete an earlier number (e.g. #2 when #3 exists) returns a 409 error with a Romanian message explaining the restriction. Also routes UI deletes through the API (like create/update) so they get proper audit logging and sequence recalculation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -216,7 +216,12 @@ export function RegistraturaModule() {
|
||||
};
|
||||
|
||||
const handleDelete = async (id: string) => {
|
||||
await removeEntry(id);
|
||||
try {
|
||||
await removeEntry(id);
|
||||
} catch (err) {
|
||||
const msg = err instanceof Error ? err.message : "Eroare la ștergere";
|
||||
alert(msg);
|
||||
}
|
||||
};
|
||||
|
||||
/** All closes go through the close dialog */
|
||||
|
||||
Reference in New Issue
Block a user