From 090b0300023ac9aaa117647eeb55e90fb69b1a1a Mon Sep 17 00:00:00 2001 From: Samuel Lorch Date: Tue, 7 Nov 2023 19:04:57 +0100 Subject: [PATCH] Add Confirm on Name Change --- client/src/pages/[subsystem]/[entity]/edit/[id].vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/src/pages/[subsystem]/[entity]/edit/[id].vue b/client/src/pages/[subsystem]/[entity]/edit/[id].vue index 7639d25..5df830a 100644 --- a/client/src/pages/[subsystem]/[entity]/edit/[id].vue +++ b/client/src/pages/[subsystem]/[entity]/edit/[id].vue @@ -35,7 +35,14 @@ async function update() { if (editTypes[subsystem][entity].idType == 'Number') { res = await apiCall(`${subsystem}.${entity}.update`, {index: id as number - 0, thing: vm}); } else { - res = await apiCall(`${subsystem}.${entity}.update`, {name: id, thing: vm}); + if (id != vm.name) { + if (confirm('You are about to Change the name and all references, are you Sure?')) { + res = await apiCall(`${subsystem}.${entity}.update`, {name: id, thing: vm}); + } + + } else { + res = await apiCall(`${subsystem}.${entity}.update`, {name: id, thing: vm}); + } } if (res.Error === null) {