From aee3c67ee08593dbd6487f4d44caedd8d3f5298d Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 6 Jun 2024 09:33:01 +0200 Subject: [PATCH] clean code --- src/components/FormModel.vue | 7 ++++--- src/pages/Account/Role/AccountRoles.vue | 2 +- src/pages/Account/Role/Card/InheritedRoles.vue | 1 + src/pages/Account/Role/Card/RoleForm.vue | 14 ++++---------- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 03f75477d..7d4e0e223 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -196,13 +196,13 @@ async function save() { if ($props.urlCreate) notify('globals.dataCreated', 'positive'); - hasChanges.value = false; - isLoading.value = false; - updateAndEmit(response?.data, 'onDataSaved'); } catch (err) { console.error(err); notify('errors.writeRequest', 'negative'); + } finally { + hasChanges.value = false; + isLoading.value = false; } } @@ -239,6 +239,7 @@ function updateAndEmit(val, evt) { originalData.value = val && JSON.parse(JSON.stringify(val)); if (!$props.url) arrayData.store.data = val; + console.log('$props.model: ', $props.model); emit(evt, state.get($props.model)); } diff --git a/src/pages/Account/Role/AccountRoles.vue b/src/pages/Account/Role/AccountRoles.vue index afa86a480..f4197e433 100644 --- a/src/pages/Account/Role/AccountRoles.vue +++ b/src/pages/Account/Role/AccountRoles.vue @@ -82,7 +82,7 @@ const navigate = (event, id) => {
- +