优化
This commit is contained in:
@@ -32,11 +32,12 @@ function normalizePage(payload: PagePayload): TruckAppointmentPage {
|
||||
}
|
||||
|
||||
function normalizeResource(resource: TruckAppointmentResource): TruckAppointmentResource {
|
||||
const idKeys = ['id', 'outboundOrderId', 'oceanBookingId', 'containerBookingId', 'loadingPlanId', 'warehouseId', 'customerId', 'carrierId']
|
||||
const idKeys = ['id', 'outboundOrderId', 'oceanBookingId', 'containerBookingId', 'loadingPlanId', 'warehouseId', 'customerId', 'shippingCompanyId', 'bookingAgentId', 'carrierId']
|
||||
const normalized = { ...resource } as Record<string, unknown>
|
||||
for (const key of idKeys) {
|
||||
if (normalized[key] !== null && normalized[key] !== undefined) normalized[key] = String(normalized[key])
|
||||
}
|
||||
normalized.attachmentCount = Number(normalized.attachmentCount ?? 0)
|
||||
return normalized as unknown as TruckAppointmentResource
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user