This commit is contained in:
@@ -11,7 +11,7 @@ const statusItems = [
|
||||
{ label: 'All Statuses', value: null },
|
||||
{ label: 'Quote Requested', value: 'quote_requested' },
|
||||
{ label: 'Quotes Received', value: 'quotes_received' },
|
||||
{ label: 'Solicitation Sent', value: 'solicitation_sent' },
|
||||
{ label: 'Awaiting Policy', value: 'awaiting_policy' },
|
||||
{ label: 'Issued', value: 'issued' }
|
||||
]
|
||||
|
||||
@@ -45,6 +45,11 @@ const { data, pending, refresh } = usePolicy('/policies', {
|
||||
})
|
||||
})
|
||||
|
||||
// Ensure data is refreshed when page loads
|
||||
onMounted(() => {
|
||||
refresh()
|
||||
})
|
||||
|
||||
const policies = computed(() => data.value?.data ?? [])
|
||||
const meta = computed(() => data.value?.meta)
|
||||
|
||||
@@ -67,7 +72,7 @@ function policyApplicantDoc(p: any) {
|
||||
}
|
||||
|
||||
function policyDetailsSummary(p: any) {
|
||||
const d = p.policy_details
|
||||
const d = p.insured_object
|
||||
if (!d || typeof d !== 'object') return '—'
|
||||
if (p.policy_type === 'car') {
|
||||
const parts = [d.year, d.make, d.model].filter((x: any) => x !== undefined && x !== null && String(x) !== '')
|
||||
@@ -86,7 +91,7 @@ function statusColor(status: string) {
|
||||
switch (status) {
|
||||
case 'quote_requested': return 'yellow'
|
||||
case 'quotes_received': return 'blue'
|
||||
case 'solicitation_sent': return 'purple'
|
||||
case 'awaiting_policy': return 'purple'
|
||||
case 'issued': return 'green'
|
||||
default: return 'gray'
|
||||
}
|
||||
@@ -96,7 +101,7 @@ function statusLabel(status: string) {
|
||||
switch (status) {
|
||||
case 'quote_requested': return 'Quote Requested'
|
||||
case 'quotes_received': return 'Quotes Received'
|
||||
case 'solicitation_sent': return 'Solicitation Sent'
|
||||
case 'awaiting_policy': return 'Awaiting Policy'
|
||||
case 'issued': return 'Issued'
|
||||
default: return status
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user