1
0
forked from test/crm

fix: update lead

This commit is contained in:
Shariq Ansari 2023-08-08 16:29:19 +05:30
parent dc9858ff87
commit 847d238131

View File

@ -32,6 +32,7 @@
</template>
</Dropdown>
<Button icon="more-horizontal" />
<Button label="Save" variant="solid" @click="() => updateLead()" />
</template>
</LayoutHeader>
<TabGroup v-if="lead.data" @change="onTabChange">
@ -217,6 +218,7 @@ import { dateFormat, timeAgo, dateTooltipFormat } from '@/utils'
import { usersStore } from '@/stores/users'
import {
createResource,
createDocumentResource,
FeatherIcon,
Autocomplete,
FormControl,
@ -241,6 +243,22 @@ const lead = createResource({
auto: true,
})
const uLead = createDocumentResource({
doctype: 'CRM Lead',
name: props.leadId,
setValue: {
onSuccess: () => {
lead.reload()
},
},
})
function updateLead() {
let leadCopy = { ...lead.data }
delete leadCopy.activities
uLead.setValue.submit({ ...leadCopy })
}
const breadcrumbs = computed(() => {
let items = [{ label: 'Leads', route: { name: 'Leads' } }]
items.push({