washday-sdk 0.0.12 → 0.0.14

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/index.js CHANGED
@@ -5,6 +5,7 @@ const get_2 = require("./stores/get");
5
5
  const WashdayClient = function WashdayClient(apiToken) {
6
6
  this.apiToken = apiToken;
7
7
  WashdayClient.prototype.customers.apiToken = apiToken;
8
+ WashdayClient.prototype.stores.apiToken = apiToken;
8
9
  };
9
10
  WashdayClient.prototype.customers = {
10
11
  getCustomerById: get_1.getCustomerById,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/api/index.ts CHANGED
@@ -11,6 +11,7 @@ type WashdayClientConstructor = {
11
11
  const WashdayClient: WashdayClientConstructor = function WashdayClient(this: WashdayClientInstance, apiToken: string) {
12
12
  this.apiToken = apiToken;
13
13
  WashdayClient.prototype.customers.apiToken = apiToken;
14
+ WashdayClient.prototype.stores.apiToken = apiToken;
14
15
  } as any;
15
16
 
16
17
  WashdayClient.prototype.customers = {
@@ -1,6 +1,4 @@
1
1
  import { WashdayClientInstance } from "../../interfaces/Api";
2
- import { ICustomer } from "../../interfaces/Customer";
3
- import { IOrderInfo } from "../../interfaces/Order";
4
2
  import { IStore } from "../../interfaces/Store";
5
3
  import axiosInstance from "../axiosInstance";
6
4
 
@@ -9,9 +7,15 @@ const REQUEST_PARAMS = {
9
7
  token: 'LOGGED_USER_TOKEN',
10
8
  };
11
9
 
12
- export const getStores = async function (this: WashdayClientInstance): Promise<{ stores: IStore[] }> {
10
+ export const getStores = async function (this: WashdayClientInstance, params: {
11
+ isActive?: string
12
+ }): Promise<{ stores: IStore[] }> {
13
13
  try {
14
14
  REQUEST_PARAMS.token = this.apiToken;
15
+ let queryParams = '';
16
+ if (params.isActive) {
17
+ queryParams += `isActive=${params.isActive}`
18
+ }
15
19
  const response = await axiosInstance.get(`${GET_SET_STORES}`, { params: { ...REQUEST_PARAMS } });
16
20
  return response.data?.data?.stores || [];
17
21
  } catch (error) {