fix: only fetch org if org exist

This commit is contained in:
Shariq Ansari 2024-09-27 20:34:54 +05:30
parent 200c931f05
commit 45b006b580
2 changed files with 14 additions and 8 deletions

View File

@ -376,10 +376,13 @@ const deal = createResource({
params: { name: props.dealId },
cache: ['deal', props.dealId],
onSuccess: async (data) => {
organization.update({
params: { doctype: 'CRM Organization', name: data.organization },
})
organization.fetch()
if (data.organization) {
organization.update({
params: { doctype: 'CRM Organization', name: data.organization },
})
organization.fetch()
}
let obj = {
doc: data,
$dialog,

View File

@ -309,10 +309,13 @@ const deal = createResource({
params: { name: props.dealId },
cache: ['deal', props.dealId],
onSuccess: async (data) => {
organization.update({
params: { doctype: 'CRM Organization', name: data.organization },
})
organization.fetch()
if (data.organization) {
organization.update({
params: { doctype: 'CRM Organization', name: data.organization },
})
organization.fetch()
}
let obj = {
doc: data,
$dialog,