优化
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { overseasHttp } from '@/shared/api/overseasHttp'
|
||||
import { unwrapApiResponse, type ApiEnvelope } from '@/shared/api/http'
|
||||
import { listSharedReceivingOverseasWarehouseOptions } from '@/modules/iam'
|
||||
import { normalizeOverseasPage, type OverseasPagePayload } from './lastMileOrders'
|
||||
|
||||
export interface RelabelOrderQuery {
|
||||
@@ -105,12 +106,16 @@ export async function getRelabelOrder(relabelNo: string) {
|
||||
return unwrapApiResponse(response)
|
||||
}
|
||||
|
||||
export async function listRelabelWarehouseOptions(customerId: string) {
|
||||
const response = await overseasHttp.get<ApiEnvelope<OverseasPagePayload<RelabelWarehouseOptionDto>>, ApiEnvelope<OverseasPagePayload<RelabelWarehouseOptionDto>>>(
|
||||
'/platform/v1/warehouse-admin',
|
||||
{ params: { customerId, page: 1, size: 200, status: 'ACTIVE' } },
|
||||
)
|
||||
return normalizeOverseasPage(unwrapApiResponse(response))
|
||||
export async function listRelabelWarehouseOptions() {
|
||||
const records: RelabelWarehouseOptionDto[] = (await listSharedReceivingOverseasWarehouseOptions()).map((warehouse) => ({
|
||||
id: warehouse.id,
|
||||
customerId: '0',
|
||||
warehouseCode: warehouse.warehouseCode,
|
||||
warehouseName: warehouse.warehouseName,
|
||||
warehouseType: 'OVERSEAS',
|
||||
status: 'ACTIVE',
|
||||
}))
|
||||
return { records, page: 1, size: 200, total: records.length, pages: records.length ? 1 : 0 }
|
||||
}
|
||||
|
||||
export async function createRelabelOrder(customerId: string, payload: CreateRelabelPayload) {
|
||||
|
||||
Reference in New Issue
Block a user