hotfix(webshipper): only show order channel methods
This commit is contained in:
@@ -23,7 +23,9 @@ class WebshipperFulfillmentService extends FulfillmentService {
|
||||
}
|
||||
|
||||
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) => ({
|
||||
id: r.attributes.name,
|
||||
|
||||
@@ -46,8 +46,16 @@ class Webshipper {
|
||||
url: path,
|
||||
}).then(({ data }) => data)
|
||||
},
|
||||
list: async () => {
|
||||
const path = `/v2/shipping_rates`
|
||||
list: async (params = {}) => {
|
||||
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_({
|
||||
method: "GET",
|
||||
url: path,
|
||||
|
||||
Reference in New Issue
Block a user