Skip to content

Commit ca7b96b

Browse files
committed
Added actions
1 parent 045c9ed commit ca7b96b

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

components/finerworks/actions/get-prices/get-prices.mjs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,18 @@ export default {
2929
async run({ $ }) {
3030
const response = await this.app.getPrices({
3131
$,
32-
data: [
33-
{
34-
product_qty: this.productQty,
35-
product_sku: this.productSku,
36-
},
37-
],
32+
data: {
33+
products: [
34+
{
35+
product_qty: this.productQty,
36+
product_sku: this.productSku,
37+
},
38+
],
39+
},
3840
});
39-
$.export("$summary", "Successfully sent the request");
41+
$.export("$summary", `Successfully retrieved ${response.prices.length} ${response.prices.length > 1
42+
? "prices"
43+
: "price"} for product SKU ${this.productSku}`);
4044
return response;
4145
},
4246
};

components/finerworks/finerworks.app.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ export default {
9797
headers,
9898
...otherOpts
9999
} = opts;
100+
console.log({
101+
...otherOpts,
102+
url: this._baseUrl() + path,
103+
headers: {
104+
"web_api_key": `${this.$auth.web_api_key}`,
105+
"app_key": `${this.$auth.app_key}`,
106+
...headers,
107+
},
108+
});
100109
return axios($, {
101110
...otherOpts,
102111
url: this._baseUrl() + path,

0 commit comments

Comments
 (0)