优化
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import type { DispatchPalletCandidateDto } from './api/dispatches'
|
||||
import type { Candidate } from './dispatchContracts'
|
||||
|
||||
export type SmartDispatchWarehouseTab = 'ALL' | 'LAX' | 'NYC'
|
||||
|
||||
export function matchesSmartDispatchWarehouseTab(
|
||||
candidate: Pick<DispatchPalletCandidateDto, 'overseasWarehouseCode' | 'overseasWarehouseName'>,
|
||||
candidate: Pick<Candidate, 'warehouseCode' | 'warehouseName'>,
|
||||
tab: SmartDispatchWarehouseTab,
|
||||
) {
|
||||
if (tab === 'ALL') return true
|
||||
const warehouse = [candidate.overseasWarehouseCode, candidate.overseasWarehouseName]
|
||||
const warehouse = [candidate.warehouseCode, candidate.warehouseName]
|
||||
.map((value) => String(value || '').trim().toLowerCase())
|
||||
.filter(Boolean)
|
||||
.join(' ')
|
||||
|
||||
Reference in New Issue
Block a user