优化
This commit is contained in:
@@ -15,7 +15,7 @@ describe('overseas inventory API', () => {
|
|||||||
await getInventorySummary(query)
|
await getInventorySummary(query)
|
||||||
|
|
||||||
expect(overseasHttp.get).toHaveBeenNthCalledWith(1, '/platform/v1/last-leg/inventory/balances', { params: query })
|
expect(overseasHttp.get).toHaveBeenNthCalledWith(1, '/platform/v1/last-leg/inventory/balances', { params: query })
|
||||||
expect(overseasHttp.get).toHaveBeenNthCalledWith(2, '/platform/v1/last-leg/inventory/summary', { params: { customerId: '100', skuCode: 'SKU-1', warehouseLocationCode: 'A-01' } })
|
expect(overseasHttp.get).toHaveBeenNthCalledWith(2, '/platform/v1/last-leg/inventory/summary', { params: { customerId: '100', page: 1, size: 200, skuCode: 'SKU-1', warehouseLocationCode: 'A-01' } })
|
||||||
})
|
})
|
||||||
|
|
||||||
it('uses the read-only position and ledger endpoints with explicit customer scope', async () => {
|
it('uses the read-only position and ledger endpoints with explicit customer scope', async () => {
|
||||||
|
|||||||
@@ -120,9 +120,8 @@ export async function listInventoryBalances(query: InventoryBalanceQuery) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getInventorySummary(query: InventoryBalanceQuery) {
|
export async function getInventorySummary(query: InventoryBalanceQuery) {
|
||||||
const { page: _page, size: _size, ...summaryParams } = params(query)
|
|
||||||
const response = await overseasHttp.get<ApiEnvelope<InventoryDashboardDto>, ApiEnvelope<InventoryDashboardDto>>(
|
const response = await overseasHttp.get<ApiEnvelope<InventoryDashboardDto>, ApiEnvelope<InventoryDashboardDto>>(
|
||||||
'/platform/v1/last-leg/inventory/summary', { params: summaryParams },
|
'/platform/v1/last-leg/inventory/summary', { params: params({ ...query, page: 1, size: 200 }) },
|
||||||
)
|
)
|
||||||
return unwrapApiResponse(response)
|
return unwrapApiResponse(response)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user