fix(client): use final order address route

This commit is contained in:
2026-09-01 19:47:28 +08:00
parent 1305ae4669
commit fb8a4743f6
2 changed files with 7 additions and 6 deletions
+4 -4
View File
@@ -485,19 +485,19 @@ export function getMerchantInboundCodePolicy() {
}
export function getMerchantOrderAddresses(addressType?: CustomerOrderAddressType) {
return apiRequest<CustomerOrderAddress[]>({ method: 'GET', url: '/merchant/v1/order-addresses', params: { addressType } })
return apiRequest<CustomerOrderAddress[]>({ method: 'GET', url: '/merchant/v1/orders/first-leg/addresses', params: { addressType } })
}
export function createMerchantOrderAddress(payload: CustomerOrderAddressSaveRequest) {
return apiRequest<number | string>({ method: 'POST', url: '/merchant/v1/order-addresses', data: payload })
return apiRequest<number | string>({ method: 'POST', url: '/merchant/v1/orders/first-leg/addresses', data: payload })
}
export function updateMerchantOrderAddress(id: number | string, payload: CustomerOrderAddressSaveRequest) {
return apiRequest<void>({ method: 'PUT', url: `/merchant/v1/order-addresses/${id}`, data: payload })
return apiRequest<void>({ method: 'PUT', url: `/merchant/v1/orders/first-leg/addresses/${id}`, data: payload })
}
export function disableMerchantOrderAddress(id: number | string) {
return apiRequest<void>({ method: 'DELETE', url: `/merchant/v1/order-addresses/${id}` })
return apiRequest<void>({ method: 'DELETE', url: `/merchant/v1/orders/first-leg/addresses/${id}` })
}
export function downloadMerchantFirstLegBatchImportTemplate() {
@@ -29,8 +29,9 @@ test('declares the documented merchant warehouse and first-leg endpoints', () =>
assert.match(apiSource, /url: '\/merchant\/v1\/orders\/first-leg'/)
assert.match(apiSource, /url: '\/merchant\/v1\/orders\/first-leg\/inbound-code-policy'/)
assert.match(apiSource, /url: '\/merchant\/v1\/orders\/first-leg\/batch'/)
assert.match(apiSource, /url: '\/merchant\/v1\/order-addresses'/)
assert.match(apiSource, /`\/merchant\/v1\/order-addresses\/\$\{id\}`/)
assert.match(apiSource, /url: '\/merchant\/v1\/orders\/first-leg\/addresses'/)
assert.match(apiSource, /`\/merchant\/v1\/orders\/first-leg\/addresses\/\$\{id\}`/)
assert.doesNotMatch(apiSource, /merchant\/v1\/order-addresses/)
assert.match(apiSource, /url: '\/merchant\/v1\/orders\/first-leg\/batch-imports\/template'/)
assert.match(apiSource, /url: '\/merchant\/v1\/orders\/first-leg\/batch-imports'/)
assert.match(apiSource, /params: \{ mode \}/)