fix(first-leg): show cancelled orders as terminal details
This commit is contained in:
@@ -41,11 +41,11 @@ export function canClientCancelFirstLegOrder(status: FirstLegOrderStatus) {
|
||||
}
|
||||
|
||||
export const FIRST_LEG_PROGRESS_STAGES = FIRST_LEG_ORDER_STATUSES.filter(
|
||||
(item): item is (typeof FIRST_LEG_ORDER_STATUSES)[number] & { code: Exclude<FirstLegOrderStatus, 'DRAFT'> } => item.code !== 'DRAFT',
|
||||
(item): item is (typeof FIRST_LEG_ORDER_STATUSES)[number] & { code: Exclude<FirstLegOrderStatus, 'DRAFT' | 'CANCELLED'> } => item.code !== 'DRAFT' && item.code !== 'CANCELLED',
|
||||
)
|
||||
|
||||
export function getFirstLegProgressIndex(status: FirstLegOrderStatus) {
|
||||
if (status === 'DRAFT') return -1
|
||||
if (status === 'DRAFT' || status === 'CANCELLED') return -1
|
||||
return FIRST_LEG_PROGRESS_STAGES.findIndex((item) => item.code === status)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user