washday-sdk 0.0.171 → 0.0.172

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.
@@ -7,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ import { generateQueryParamsStr } from "../../utils/apiUtils";
10
11
  import axiosInstance from "../axiosInstance";
11
12
  const GET_SET_DISCOUNT_CODES = 'api/v2/discountCodes';
12
13
  const GET_SET_AUTOMATIC_DISCOUNTS = 'api/discounts';
@@ -33,10 +34,9 @@ export const getDiscountCodes = function (storeId, params) {
33
34
  export const getAutomaticDiscounts = function (storeId, params) {
34
35
  return __awaiter(this, void 0, void 0, function* () {
35
36
  try {
36
- let queryParams = '';
37
- // if (params.isActive) {
38
- // queryParams += `isActive=${params.isActive}`
39
- // }
37
+ const queryParams = generateQueryParamsStr([
38
+ 'currentDate',
39
+ ], params);
40
40
  const config = {
41
41
  headers: { Authorization: `Bearer ${this.apiToken}` }
42
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.171",
3
+ "version": "0.0.172",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1,4 +1,5 @@
1
1
  import { WashdayClientInstance } from "../../interfaces/Api";
2
+ import { generateQueryParamsStr } from "../../utils/apiUtils";
2
3
  import axiosInstance from "../axiosInstance";
3
4
 
4
5
  const GET_SET_DISCOUNT_CODES = 'api/v2/discountCodes';
@@ -22,12 +23,12 @@ export const getDiscountCodes = async function (this: WashdayClientInstance, sto
22
23
  }
23
24
  };
24
25
 
25
- export const getAutomaticDiscounts = async function (this: WashdayClientInstance, storeId: string, params?: string): Promise<any> {
26
+ export const getAutomaticDiscounts = async function (this: WashdayClientInstance, storeId: string, params?: {}): Promise<any> {
26
27
  try {
27
- let queryParams = '';
28
- // if (params.isActive) {
29
- // queryParams += `isActive=${params.isActive}`
30
- // }
28
+ const queryParams = generateQueryParamsStr([
29
+ 'currentDate',
30
+ ], params);
31
+
31
32
  const config = {
32
33
  headers: { Authorization: `Bearer ${this.apiToken}` }
33
34
  };