feat(admin): simplify truck payable currency
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { http, unwrapApiResponse, type ApiEnvelope } from '@/shared/api/http'
|
||||
import { TRUCK_APPOINTMENT_SAVE_FIELDS } from '../types'
|
||||
import { TRUCK_APPOINTMENT_SAVE_FIELDS, normalizeTruckAppointmentCurrency } from '../types'
|
||||
import type {
|
||||
SaveTruckAppointmentRequest,
|
||||
TruckAppointmentPage,
|
||||
@@ -17,7 +17,7 @@ function operationId(action: string, id: string | number) {
|
||||
|
||||
function dtoPayload(payload: SaveTruckAppointmentRequest) {
|
||||
return Object.fromEntries(TRUCK_APPOINTMENT_SAVE_FIELDS.flatMap((key) => {
|
||||
const value = payload[key]
|
||||
const value = key === 'currency' ? normalizeTruckAppointmentCurrency(payload[key]) : payload[key]
|
||||
return value === undefined ? [] : [[key, value === '' ? null : value]]
|
||||
})) as unknown as SaveTruckAppointmentRequest
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user