This commit is contained in:
2026-09-23 11:25:37 +08:00
2 changed files with 11 additions and 4 deletions
@@ -43,6 +43,12 @@ export async function listOverseasLocations(warehouseId: string, query: Overseas
return normalizeOverseasPage(unwrapApiResponse(response))
}
export async function listAllOverseasLocations(warehouseIds: string[], query: OverseasLocationQuery = {}) {
const results = await Promise.all(warehouseIds.map((warehouseId) => listOverseasLocations(warehouseId, { ...query, page: 1, size: 200 })))
const records = results.flatMap((result) => result.records)
return { records, total: records.length }
}
export async function createOverseasLocation(warehouseId: string, payload: SaveOverseasLocationPayload) {
const response = await overseasHttp.post<ApiEnvelope<string>, ApiEnvelope<string>>(base(warehouseId), payload)
return unwrapApiResponse(response)