From 0df05ef69cfec10ef260dedab64ffe0c983761d2 Mon Sep 17 00:00:00 2001 From: Teodora Pavlova <27234545+TeodoraPavlova@users.noreply.github.com> Date: Tue, 7 May 2024 13:27:08 +0300 Subject: [PATCH] apply suggestions --- frontend/src/components/Entity.vue | 6 +++--- frontend/src/components/Schema.vue | 14 ++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/Entity.vue b/frontend/src/components/Entity.vue index ef45fd9..a4933d9 100644 --- a/frontend/src/components/Entity.vue +++ b/frontend/src/components/Entity.vue @@ -90,9 +90,9 @@ async function getEntity() { } } -async function onUpdate(entity) { - if (entity) { - entity.value = entity; +async function onUpdate(editEntity) { + if (editEntity) { + entity.value = editEntity; } } diff --git a/frontend/src/components/Schema.vue b/frontend/src/components/Schema.vue index eb1f8ed..3b88c78 100644 --- a/frontend/src/components/Schema.vue +++ b/frontend/src/components/Schema.vue @@ -86,16 +86,18 @@ onUpdated(() => { } }); -async function onSchemaUpdate() { - await getSchema(); +function init() { + loading.value = true; + getSchema().then(() => loading.value = false); +} + +function onSchemaUpdate() { + init(); } watch( route, - () => { - loading.value = true; - getSchema().then(() => loading.value = false); - }, + () => init(), { immediate: true }