fix: normalize delivery pagination
This commit is contained in:
@@ -102,6 +102,16 @@ export interface DeliveryQuery {
|
||||
plannedTo?: string
|
||||
}
|
||||
|
||||
export function normalizeDeliveryPage(data: PageResult<DeliveryRow>): PageResult<DeliveryRow> {
|
||||
return {
|
||||
...data,
|
||||
page: Number(data.page),
|
||||
size: Number(data.size),
|
||||
total: Number(data.total),
|
||||
pages: Number(data.pages),
|
||||
}
|
||||
}
|
||||
|
||||
export interface DeliveryTransferPayload {
|
||||
dispatchNo: string
|
||||
idempotencyKey: string
|
||||
@@ -127,7 +137,7 @@ export function listDeliveryOrders(params: DeliveryQuery) {
|
||||
method: 'GET',
|
||||
url: '/merchant/v1/last-leg/delivery-orders',
|
||||
params,
|
||||
})
|
||||
}).then(normalizeDeliveryPage)
|
||||
}
|
||||
|
||||
export function getDeliveryOrder(deliveryNo: string) {
|
||||
|
||||
Reference in New Issue
Block a user