added confirmation before deletion

This commit is contained in:
2025-07-15 23:52:04 +02:00
parent 97134694a2
commit bc91e69e36
2 changed files with 3 additions and 0 deletions

View File

@@ -30,6 +30,8 @@
} }
async function drop(number){ async function drop(number){
let confirmed = confirm(t('document.confirm_deletion').replace('{pos}',document.positions[number].item));
if (!confirmed) return;
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/document/${document.id}/position`; const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/document/${document.id}/position`;
const resp = await fetch(url,{ const resp = await fetch(url,{
method: 'DELETE', method: 'DELETE',

View File

@@ -10,6 +10,7 @@
"amount": "Menge", "amount": "Menge",
"bank_account": "Bankverbindung", "bank_account": "Bankverbindung",
"code": "Code", "code": "Code",
"confirm_deletion": "Soll '{pos}' wirklich gelöscht werden?",
"court": "Amtsgericht", "court": "Amtsgericht",
"create_new": "neues Dokument", "create_new": "neues Dokument",
"customer": "Kunde", "customer": "Kunde",