Skip to content

Commit

Permalink
fix: only fetch org if org exist
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Sep 27, 2024
1 parent 200c931 commit 45b006b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
11 changes: 7 additions & 4 deletions frontend/src/pages/Deal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 7 additions & 4 deletions frontend/src/pages/MobileDeal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 45b006b

Please sign in to comment.