Skip to content

Commit

Permalink
fix: on lead/deal creation error
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Nov 27, 2023
1 parent 362266f commit 9558017
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions frontend/src/pages/Deal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
/>
<div v-else>
<div
v-if="section.contacts.length"
v-if="section.contacts"
v-for="(contact, i) in section.contacts"
:key="contact.name"
>
Expand Down Expand Up @@ -320,6 +320,10 @@ const reload = ref(false)
const showOrganizationModal = ref(false)
const _organization = ref({})
const organization = computed(() => {
return deal.data?.organization && getOrganization(deal.data.organization)
})
function updateDeal(fieldname, value, callback) {
value = Array.isArray(fieldname) ? '' : value
Expand Down Expand Up @@ -422,7 +426,7 @@ function getParsedFields(sections) {
let contactSection = {
label: 'Contacts',
opened: true,
contacts: deal.data.contacts.map((contact) => {
contacts: deal.data?.contacts.map((contact) => {
return {
name: contact.contact,
is_primary: contact.is_primary,
Expand Down Expand Up @@ -505,10 +509,6 @@ async function setPrimaryContact(contact) {
}
}
const organization = computed(() => {
return getOrganization(deal.data.organization)
})
function updateField(name, value, callback) {
updateDeal(name, value, () => {
deal.data[name] = value
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/pages/Lead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ const reload = ref(false)
const showOrganizationModal = ref(false)
const _organization = ref({})
const organization = computed(() => {
return lead.data?.organization && getOrganization(lead.data.organization)
})
function updateLead(fieldname, value, callback) {
value = Array.isArray(fieldname) ? '' : value
Expand Down Expand Up @@ -336,10 +340,6 @@ function getParsedFields(sections) {
return sections
}
const organization = computed(() => {
return getOrganization(lead.data.organization)
})
async function convertToDeal() {
let deal = await call('crm.fcrm.doctype.crm_lead.crm_lead.convert_to_deal', {
lead: lead.data.name,
Expand Down

0 comments on commit 9558017

Please sign in to comment.