1
0
forked from test/crm

fix: reload link options when doctype changes

This commit is contained in:
Shariq Ansari 2023-12-31 14:52:19 +05:30
parent 01beb61f0c
commit 50830e6138

View File

@ -88,17 +88,17 @@ watchDebounced(
val = val || ''
if (text.value === val) return
text.value = val
options.update({
params: {
txt: val,
doctype: props.doctype,
},
})
options.reload()
reload(val)
},
{ debounce: 300, immediate: true }
)
watchDebounced(
() => props.doctype,
() => reload(''),
{ debounce: 300, immediate: true }
)
const options = createResource({
url: 'frappe.desk.search.search_link',
cache: [props.doctype, text.value],
@ -117,6 +117,16 @@ const options = createResource({
},
})
function reload(val) {
options.update({
params: {
txt: val,
doctype: props.doctype,
},
})
options.reload()
}
const labelClasses = computed(() => {
return [
{