From 165bc9c64f9e6178248b3ad88ef1a17e85ac41c4 Mon Sep 17 00:00:00 2001 From: UmakanthKaspa Date: Thu, 29 Aug 2024 09:25:36 +0000 Subject: [PATCH 1/2] fix: reset form fields in Knowledge Base category creation dialog - Implemented function to clear dialog fields after successful creation. - Ensured fields are reset in the callback for the category creation dialog. --- .../src/pages/knowledge-base/KnowledgeBaseCategoryNew.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/desk/src/pages/knowledge-base/KnowledgeBaseCategoryNew.vue b/desk/src/pages/knowledge-base/KnowledgeBaseCategoryNew.vue index c29c13852..528a9ce7c 100644 --- a/desk/src/pages/knowledge-base/KnowledgeBaseCategoryNew.vue +++ b/desk/src/pages/knowledge-base/KnowledgeBaseCategoryNew.vue @@ -46,6 +46,13 @@ const emit = defineEmits(); const newCategoryName = ref(""); const newCategoryDescription = ref(""); const newCategoryIcon = ref(""); + +const resetForm = () => { + newCategoryName.value = ''; + newCategoryDescription.value = ''; + newCategoryIcon.value = ''; +}; + const newCategoryRes = createResource({ url: "frappe.client.insert", makeParams() { @@ -68,6 +75,7 @@ const newCategoryRes = createResource({ }, onSuccess(data) { emit("success", data.name); + resetForm(); }, }); From 724a8d1169ff17a40b709a761682e492c346ffe8 Mon Sep 17 00:00:00 2001 From: UmakanthKaspa Date: Fri, 30 Aug 2024 04:00:49 +0000 Subject: [PATCH 2/2] style: fix Prettier formatting issues in KnowledgeBaseCategoryNew.vue --- desk/src/pages/knowledge-base/KnowledgeBaseCategoryNew.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/desk/src/pages/knowledge-base/KnowledgeBaseCategoryNew.vue b/desk/src/pages/knowledge-base/KnowledgeBaseCategoryNew.vue index 528a9ce7c..8ca8bcb67 100644 --- a/desk/src/pages/knowledge-base/KnowledgeBaseCategoryNew.vue +++ b/desk/src/pages/knowledge-base/KnowledgeBaseCategoryNew.vue @@ -48,9 +48,9 @@ const newCategoryDescription = ref(""); const newCategoryIcon = ref(""); const resetForm = () => { - newCategoryName.value = ''; - newCategoryDescription.value = ''; - newCategoryIcon.value = ''; + newCategoryName.value = ""; + newCategoryDescription.value = ""; + newCategoryIcon.value = ""; }; const newCategoryRes = createResource({