From 95e0f672c9f120144a98beceedd65c3238e8ff64 Mon Sep 17 00:00:00 2001 From: Sean Matthews Date: Thu, 2 Feb 2023 17:16:58 -0500 Subject: [PATCH] listProducts with query passed in --- api-module-library/yotpo/api/coreApi.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/api-module-library/yotpo/api/coreApi.js b/api-module-library/yotpo/api/coreApi.js index a319ecc5..0640c981 100644 --- a/api-module-library/yotpo/api/coreApi.js +++ b/api-module-library/yotpo/api/coreApi.js @@ -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`, }; } @@ -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 };