fix(client): use final order address route
This commit is contained in:
@@ -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 \}/)
|
||||
|
||||
Reference in New Issue
Block a user