feat: updating category from settings

This commit is contained in:
Jannat Patel
2024-09-24 10:33:23 +05:30
parent 62cb198492
commit 6fb206cc4e
3 changed files with 7 additions and 17 deletions

View File

@@ -104,23 +104,21 @@ const showCategoryForm = () => {
}
const updateCategory = createResource({
url: 'frappe.client.set_value',
url: 'frappe.client.rename_doc',
makeParams(values) {
return {
doctype: 'LMS Category',
name: values.name,
fieldname: {
category: values.value,
},
old_name: values.name,
new_name: values.category,
}
},
})
const update = debounce((name, value) => {
const update = (name, value) => {
updateCategory.submit(
{
name: name,
value: value,
category: value,
},
{
onSuccess() {
@@ -128,7 +126,7 @@ const update = debounce((name, value) => {
},
}
)
}, 500)
}
</script>
<style>
.form-control input {

View File

@@ -254,13 +254,6 @@ const tabs = computed(() => {
})
})
watch(
() => activeTab.value,
(value) => {
console.log('Tab watcher', value)
}
)
watch(show, async () => {
if (show.value) {
const currentTab = await tabs.value
@@ -268,7 +261,6 @@ watch(show, async () => {
.find((item) => item.label === settingsStore.activeTab)
activeTab.value = currentTab || tabs.value[0].items[0]
} else {
console.log('else')
activeTab.value = null
settingsStore.isSettingsOpen = false
}

View File

@@ -21,7 +21,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-09-23 15:25:21.319427",
"modified": "2024-09-23 19:33:49.593950",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Category",