hotfix(webshipper): only show order channel methods
This commit is contained in:
@@ -23,7 +23,9 @@ class WebshipperFulfillmentService extends FulfillmentService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getFulfillmentOptions() {
|
async getFulfillmentOptions() {
|
||||||
const rates = await this.client_.shippingRates.list()
|
const rates = await this.client_.shippingRates.list({
|
||||||
|
order_channel_id: this.options_.order_channel_id,
|
||||||
|
})
|
||||||
|
|
||||||
return rates.data.map((r) => ({
|
return rates.data.map((r) => ({
|
||||||
id: r.attributes.name,
|
id: r.attributes.name,
|
||||||
|
|||||||
@@ -46,8 +46,16 @@ class Webshipper {
|
|||||||
url: path,
|
url: path,
|
||||||
}).then(({ data }) => data)
|
}).then(({ data }) => data)
|
||||||
},
|
},
|
||||||
list: async () => {
|
list: async (params = {}) => {
|
||||||
const path = `/v2/shipping_rates`
|
let path = `/v2/shipping_rates`
|
||||||
|
|
||||||
|
if (Object.entries(params).length) {
|
||||||
|
const search = Object.entries(params).map(([key, value]) => {
|
||||||
|
return `filter[${key}]=${value}`
|
||||||
|
})
|
||||||
|
path += `?${search.join("&")}`
|
||||||
|
}
|
||||||
|
|
||||||
return this.client_({
|
return this.client_({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: path,
|
url: path,
|
||||||
|
|||||||
Reference in New Issue
Block a user