1
0
forked from test/crm

fix: update onboarding status when deal status is changed

This commit is contained in:
Shariq Ansari 2025-03-12 18:17:05 +05:30
parent 41c65eb777
commit 5862745253
2 changed files with 24 additions and 0 deletions

View File

@ -149,6 +149,20 @@ const steps = reactive([
title: 'Change deal status',
icon: markRaw(StepsIcon),
completed: false,
onClick: async () => {
minimize.value = true
let deal = await getFirstDeal()
if (deal) {
router.push({
name: 'Deal',
params: { dealId: deal },
hash: '#activity',
})
} else {
router.push({ name: 'Leads' })
}
},
},
])

View File

@ -330,6 +330,10 @@ import { getSettings } from '@/stores/settings'
import { globalStore } from '@/stores/global'
import { statusesStore } from '@/stores/statuses'
import { whatsappEnabled, callEnabled } from '@/composables/settings'
import {
isOnboardingStepsCompleted,
useOnboarding,
} from '@/composables/onboarding'
import {
createResource,
Dropdown,
@ -347,6 +351,8 @@ import { useActiveTabManager } from '@/composables/useActiveTabManager'
const { brand } = getSettings()
const { $dialog, $socket, makeCall } = globalStore()
const { statusOptions, getDealStatus } = statusesStore()
const { updateOnboardingStep } = useOnboarding()
const route = useRoute()
const router = useRouter()
@ -690,6 +696,10 @@ function triggerCall() {
}
function updateField(name, value, callback) {
if (name == 'status' && !isOnboardingStepsCompleted.value) {
updateOnboardingStep('change_deal_status')
}
updateDeal(name, value, () => {
deal.data[name] = value
callback?.()