feat: updating category from settings
This commit is contained in:
@@ -104,23 +104,21 @@ const showCategoryForm = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const updateCategory = createResource({
|
const updateCategory = createResource({
|
||||||
url: 'frappe.client.set_value',
|
url: 'frappe.client.rename_doc',
|
||||||
makeParams(values) {
|
makeParams(values) {
|
||||||
return {
|
return {
|
||||||
doctype: 'LMS Category',
|
doctype: 'LMS Category',
|
||||||
name: values.name,
|
old_name: values.name,
|
||||||
fieldname: {
|
new_name: values.category,
|
||||||
category: values.value,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const update = debounce((name, value) => {
|
const update = (name, value) => {
|
||||||
updateCategory.submit(
|
updateCategory.submit(
|
||||||
{
|
{
|
||||||
name: name,
|
name: name,
|
||||||
value: value,
|
category: value,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
onSuccess() {
|
onSuccess() {
|
||||||
@@ -128,7 +126,7 @@ const update = debounce((name, value) => {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}, 500)
|
}
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
.form-control input {
|
.form-control input {
|
||||||
|
|||||||
@@ -254,13 +254,6 @@ const tabs = computed(() => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(
|
|
||||||
() => activeTab.value,
|
|
||||||
(value) => {
|
|
||||||
console.log('Tab watcher', value)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
watch(show, async () => {
|
watch(show, async () => {
|
||||||
if (show.value) {
|
if (show.value) {
|
||||||
const currentTab = await tabs.value
|
const currentTab = await tabs.value
|
||||||
@@ -268,7 +261,6 @@ watch(show, async () => {
|
|||||||
.find((item) => item.label === settingsStore.activeTab)
|
.find((item) => item.label === settingsStore.activeTab)
|
||||||
activeTab.value = currentTab || tabs.value[0].items[0]
|
activeTab.value = currentTab || tabs.value[0].items[0]
|
||||||
} else {
|
} else {
|
||||||
console.log('else')
|
|
||||||
activeTab.value = null
|
activeTab.value = null
|
||||||
settingsStore.isSettingsOpen = false
|
settingsStore.isSettingsOpen = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-09-23 15:25:21.319427",
|
"modified": "2024-09-23 19:33:49.593950",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS Category",
|
"name": "LMS Category",
|
||||||
|
|||||||
Reference in New Issue
Block a user