washday-sdk 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/stores/get.js +6 -2
- package/package.json +1 -1
- package/src/api/stores/get.ts +1 -1
package/dist/api/stores/get.js
CHANGED
|
@@ -18,12 +18,16 @@ const GET_SET_STORES = 'api/store';
|
|
|
18
18
|
const REQUEST_PARAMS = {
|
|
19
19
|
token: 'LOGGED_USER_TOKEN',
|
|
20
20
|
};
|
|
21
|
-
const getStores = function () {
|
|
21
|
+
const getStores = function (params) {
|
|
22
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
23
|
var _a, _b;
|
|
24
24
|
try {
|
|
25
25
|
REQUEST_PARAMS.token = this.apiToken;
|
|
26
|
-
|
|
26
|
+
let queryParams = '';
|
|
27
|
+
if (params.isActive) {
|
|
28
|
+
queryParams += `isActive=${params.isActive}`;
|
|
29
|
+
}
|
|
30
|
+
const response = yield axiosInstance_1.default.get(`${GET_SET_STORES}?${queryParams}`, { params: Object.assign({}, REQUEST_PARAMS) });
|
|
27
31
|
return ((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.stores) || [];
|
|
28
32
|
}
|
|
29
33
|
catch (error) {
|
package/package.json
CHANGED
package/src/api/stores/get.ts
CHANGED
|
@@ -16,7 +16,7 @@ export const getStores = async function (this: WashdayClientInstance, params: {
|
|
|
16
16
|
if (params.isActive) {
|
|
17
17
|
queryParams += `isActive=${params.isActive}`
|
|
18
18
|
}
|
|
19
|
-
const response = await axiosInstance.get(`${GET_SET_STORES}`, { params: { ...REQUEST_PARAMS } });
|
|
19
|
+
const response = await axiosInstance.get(`${GET_SET_STORES}?${queryParams}`, { params: { ...REQUEST_PARAMS } });
|
|
20
20
|
return response.data?.data?.stores || [];
|
|
21
21
|
} catch (error) {
|
|
22
22
|
console.error('Error fetching getStores:', error);
|