Skip to content

Commit

Permalink
Merge pull request #119 from friggframework/fr/yotpo-list-products
Browse files Browse the repository at this point in the history
listProducts with query passed in
  • Loading branch information
seanspeaks authored Feb 2, 2023
2 parents 854ef7f + 95e0f67 commit ee67f73
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions api-module-library/yotpo/api/coreApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class coreApi extends ApiKeyRequester {
`${this.baseUrl}/v3/stores/${this.store_id}/orders`,
getOrder: (yotpo_order_id) =>
`${this.baseUrl}/v3/stores/${this.store_id}/orders/${yotpo_order_id}`,
listProducts: () =>
`${this.baseUrl}/v3/stores/${this.store_id}/products`,
};
}

Expand Down Expand Up @@ -67,6 +69,16 @@ class coreApi extends ApiKeyRequester {
const res = await this._get(options);
return res;
}

async listProducts(query) {
const options = {
url: this.URLs.listProducts(),
query
};

const res = await this._get(options);
return res;
}
}

module.exports = { coreApi };

0 comments on commit ee67f73

Please sign in to comment.