washday-sdk 1.1.10 → 1.2.1
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/attendance/get.js +4 -5
- package/dist/api/attendance/post.js +2 -3
- package/dist/api/attendance/put.js +1 -2
- package/dist/api/auth/post.js +13 -14
- package/dist/api/axiosInstance.js +47 -36
- package/dist/api/cashierbox/delete.js +2 -3
- package/dist/api/cashierbox/get.js +3 -4
- package/dist/api/cashierbox/post.js +2 -3
- package/dist/api/cashierbox/put.js +2 -3
- package/dist/api/cashups/delete.js +1 -2
- package/dist/api/cashups/get.js +3 -4
- package/dist/api/cashups/post.js +1 -2
- package/dist/api/cashups/put.js +2 -2
- package/dist/api/cfdi/delete.js +1 -2
- package/dist/api/cfdi/get.js +6 -7
- package/dist/api/cfdi/post.js +2 -3
- package/dist/api/cfdi/put.js +2 -2
- package/dist/api/companies/get.js +1 -2
- package/dist/api/companies/post.js +2 -3
- package/dist/api/companies/put.js +3 -4
- package/dist/api/countries/get.js +1 -2
- package/dist/api/csv/get.js +13 -14
- package/dist/api/customers/delete.js +2 -3
- package/dist/api/customers/get.js +6 -7
- package/dist/api/customers/post.js +2 -3
- package/dist/api/customers/put.js +3 -4
- package/dist/api/discounts/get.js +7 -8
- package/dist/api/discounts/post.js +2 -3
- package/dist/api/discounts/put.js +4 -5
- package/dist/api/index.js +4 -1
- package/dist/api/inventory/delete.js +1 -2
- package/dist/api/inventory/get.js +3 -4
- package/dist/api/inventory/post.js +1 -2
- package/dist/api/inventory/put.js +2 -3
- package/dist/api/order/delete.js +2 -3
- package/dist/api/order/get.js +8 -9
- package/dist/api/order/post.js +7 -8
- package/dist/api/order/put.js +13 -14
- package/dist/api/outsourcedOrders/delete.js +1 -2
- package/dist/api/outsourcedOrders/get.js +3 -4
- package/dist/api/outsourcedOrders/post.js +1 -2
- package/dist/api/outsourcedOrders/put.js +1 -2
- package/dist/api/partners/delete.js +1 -2
- package/dist/api/partners/get.js +2 -3
- package/dist/api/partners/post.js +1 -2
- package/dist/api/partners/put.js +1 -2
- package/dist/api/pdf/get.js +1 -2
- package/dist/api/products/delete.js +3 -4
- package/dist/api/products/get.js +1 -2
- package/dist/api/products/post.js +4 -5
- package/dist/api/products/put.js +3 -4
- package/dist/api/publics/get.js +1 -2
- package/dist/api/reports/get.js +15 -16
- package/dist/api/reviews/delete.js +1 -1
- package/dist/api/reviews/get.js +2 -3
- package/dist/api/reviews/post.js +1 -1
- package/dist/api/reviews/put.js +2 -2
- package/dist/api/routes/delete.js +1 -2
- package/dist/api/routes/get.js +5 -6
- package/dist/api/routes/post.js +3 -4
- package/dist/api/routes/put.js +3 -4
- package/dist/api/sections/delete.js +1 -2
- package/dist/api/sections/get.js +3 -4
- package/dist/api/sections/post.js +1 -2
- package/dist/api/sections/put.js +1 -2
- package/dist/api/staff/delete.js +1 -2
- package/dist/api/staff/get.js +2 -3
- package/dist/api/staff/post.js +1 -2
- package/dist/api/staff/put.js +1 -2
- package/dist/api/stores/get.js +6 -7
- package/dist/api/stores/post.js +3 -4
- package/dist/api/stores/put.js +2 -3
- package/dist/api/stripe/post.js +4 -5
- package/dist/api/supplies/delete.js +1 -2
- package/dist/api/supplies/get.js +3 -4
- package/dist/api/supplies/post.js +1 -2
- package/dist/api/supplies/put.js +2 -3
- package/dist/api/users/delete.js +1 -2
- package/dist/api/users/post.js +1 -2
- package/dist/api/users/put.js +1 -2
- package/package.json +1 -1
- package/src/api/attendance/get.ts +4 -4
- package/src/api/attendance/post.ts +2 -2
- package/src/api/attendance/put.ts +1 -1
- package/src/api/auth/post.ts +13 -13
- package/src/api/axiosInstance.ts +51 -40
- package/src/api/cashierbox/delete.ts +2 -2
- package/src/api/cashierbox/get.ts +3 -3
- package/src/api/cashierbox/post.ts +2 -2
- package/src/api/cashierbox/put.ts +2 -2
- package/src/api/cashups/delete.ts +1 -1
- package/src/api/cashups/get.ts +3 -3
- package/src/api/cashups/post.ts +1 -1
- package/src/api/cashups/put.ts +2 -2
- package/src/api/cfdi/delete.ts +1 -1
- package/src/api/cfdi/get.ts +6 -6
- package/src/api/cfdi/post.ts +2 -2
- package/src/api/cfdi/put.ts +2 -2
- package/src/api/companies/get.ts +1 -1
- package/src/api/companies/post.ts +2 -2
- package/src/api/companies/put.ts +3 -3
- package/src/api/countries/get.ts +1 -1
- package/src/api/csv/get.ts +13 -13
- package/src/api/customers/delete.ts +2 -2
- package/src/api/customers/get.ts +6 -6
- package/src/api/customers/post.ts +2 -2
- package/src/api/customers/put.ts +3 -3
- package/src/api/discounts/get.ts +7 -7
- package/src/api/discounts/post.ts +2 -2
- package/src/api/discounts/put.ts +4 -4
- package/src/api/index.ts +4 -2
- package/src/api/inventory/delete.ts +1 -1
- package/src/api/inventory/get.ts +3 -3
- package/src/api/inventory/post.ts +1 -1
- package/src/api/inventory/put.ts +2 -2
- package/src/api/order/delete.ts +2 -2
- package/src/api/order/get.ts +8 -8
- package/src/api/order/post.ts +7 -7
- package/src/api/order/put.ts +13 -13
- package/src/api/outsourcedOrders/delete.ts +1 -1
- package/src/api/outsourcedOrders/get.ts +3 -3
- package/src/api/outsourcedOrders/post.ts +1 -1
- package/src/api/outsourcedOrders/put.ts +1 -1
- package/src/api/partners/delete.ts +1 -1
- package/src/api/partners/get.ts +2 -2
- package/src/api/partners/post.ts +1 -1
- package/src/api/partners/put.ts +1 -1
- package/src/api/pdf/get.ts +1 -1
- package/src/api/products/delete.ts +3 -3
- package/src/api/products/get.ts +1 -1
- package/src/api/products/post.ts +4 -4
- package/src/api/products/put.ts +3 -3
- package/src/api/publics/get.ts +1 -1
- package/src/api/reports/get.ts +15 -15
- package/src/api/reviews/delete.ts +1 -1
- package/src/api/reviews/get.ts +2 -2
- package/src/api/reviews/post.ts +1 -1
- package/src/api/reviews/put.ts +2 -2
- package/src/api/routes/delete.ts +1 -1
- package/src/api/routes/get.ts +5 -5
- package/src/api/routes/post.ts +3 -3
- package/src/api/routes/put.ts +3 -3
- package/src/api/sections/delete.ts +1 -1
- package/src/api/sections/get.ts +3 -3
- package/src/api/sections/post.ts +1 -1
- package/src/api/sections/put.ts +1 -1
- package/src/api/staff/delete.ts +1 -1
- package/src/api/staff/get.ts +2 -2
- package/src/api/staff/post.ts +1 -1
- package/src/api/staff/put.ts +1 -1
- package/src/api/stores/get.ts +6 -6
- package/src/api/stores/post.ts +3 -3
- package/src/api/stores/put.ts +2 -2
- package/src/api/stripe/post.ts +4 -4
- package/src/api/supplies/delete.ts +1 -1
- package/src/api/supplies/get.ts +3 -3
- package/src/api/supplies/post.ts +1 -1
- package/src/api/supplies/put.ts +2 -2
- package/src/api/users/delete.ts +1 -1
- package/src/api/users/post.ts +1 -1
- package/src/api/users/put.ts +1 -1
- package/src/interfaces/Api.ts +3 -0
package/dist/api/stripe/post.js
CHANGED
|
@@ -7,7 +7,6 @@ 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 axiosInstance from "../axiosInstance";
|
|
11
10
|
const GET_SET_STRIPE = 'api/stripe';
|
|
12
11
|
const GENERATE_CHECKOUT_SESSION = 'api/orders/create-checkout-session';
|
|
13
12
|
export const createCreateSuscriptionCheckoutSession = function (data) {
|
|
@@ -16,7 +15,7 @@ export const createCreateSuscriptionCheckoutSession = function (data) {
|
|
|
16
15
|
const config = {
|
|
17
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
18
17
|
};
|
|
19
|
-
const response = yield axiosInstance.post(`${GET_SET_STRIPE}/create-subscription-checkout-session`, data, config);
|
|
18
|
+
const response = yield this.axiosInstance.post(`${GET_SET_STRIPE}/create-subscription-checkout-session`, data, config);
|
|
20
19
|
return response;
|
|
21
20
|
}
|
|
22
21
|
catch (error) {
|
|
@@ -31,7 +30,7 @@ export const createCustomerPortalSession = function (data) {
|
|
|
31
30
|
const config = {
|
|
32
31
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
33
32
|
};
|
|
34
|
-
const response = yield axiosInstance.post(`${GET_SET_STRIPE}/create-customer-portal-session`, data, config);
|
|
33
|
+
const response = yield this.axiosInstance.post(`${GET_SET_STRIPE}/create-customer-portal-session`, data, config);
|
|
35
34
|
return response;
|
|
36
35
|
}
|
|
37
36
|
catch (error) {
|
|
@@ -46,7 +45,7 @@ export const createCFDISuscrptionCheckoutSession = function (data) {
|
|
|
46
45
|
const config = {
|
|
47
46
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
48
47
|
};
|
|
49
|
-
const response = yield axiosInstance.post(`${GET_SET_STRIPE}/create-cfdi-subscription-checkout-session`, data, config);
|
|
48
|
+
const response = yield this.axiosInstance.post(`${GET_SET_STRIPE}/create-cfdi-subscription-checkout-session`, data, config);
|
|
50
49
|
return response;
|
|
51
50
|
}
|
|
52
51
|
catch (error) {
|
|
@@ -61,7 +60,7 @@ export const createGetMoreCheckoutSession = function (data) {
|
|
|
61
60
|
const config = {
|
|
62
61
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
63
62
|
};
|
|
64
|
-
return yield axiosInstance.post(`${GENERATE_CHECKOUT_SESSION}`, data, config);
|
|
63
|
+
return yield this.axiosInstance.post(`${GENERATE_CHECKOUT_SESSION}`, data, config);
|
|
65
64
|
}
|
|
66
65
|
catch (error) {
|
|
67
66
|
console.error('Error fetching createGetMoreCheckoutSession:', error);
|
|
@@ -7,7 +7,6 @@ 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 axiosInstance from "../axiosInstance";
|
|
11
10
|
const GET_SET_SUPPLY = (storeId) => `api/store/${storeId}/supply`;
|
|
12
11
|
export const deleteSupplyById = function (storeId, id) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const deleteSupplyById = function (storeId, id) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.delete(`${GET_SET_SUPPLY(storeId)}/${id}`, config);
|
|
17
|
+
const response = yield this.axiosInstance.delete(`${GET_SET_SUPPLY(storeId)}/${id}`, config);
|
|
19
18
|
return response;
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
package/dist/api/supplies/get.js
CHANGED
|
@@ -7,7 +7,6 @@ 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 axiosInstance from "../axiosInstance";
|
|
11
10
|
const GET_SET_SUPPLY = (storeId) => `api/store/${storeId}/supply`;
|
|
12
11
|
export const getSupplies = function (storeId, queryParams) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const getSupplies = function (storeId, queryParams) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.get(`${GET_SET_SUPPLY(storeId)}?${queryParams}`, config);
|
|
17
|
+
const response = yield this.axiosInstance.get(`${GET_SET_SUPPLY(storeId)}?${queryParams}`, config);
|
|
19
18
|
return response;
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
@@ -30,7 +29,7 @@ export const getSupplyById = function (storeId, id) {
|
|
|
30
29
|
const config = {
|
|
31
30
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
31
|
};
|
|
33
|
-
return yield axiosInstance.get(`${GET_SET_SUPPLY(storeId)}/${id}`, config);
|
|
32
|
+
return yield this.axiosInstance.get(`${GET_SET_SUPPLY(storeId)}/${id}`, config);
|
|
34
33
|
}
|
|
35
34
|
catch (error) {
|
|
36
35
|
console.error('Error fetching getStoreSupplyById:', error);
|
|
@@ -51,7 +50,7 @@ export const getSupplyHistory = function (storeId, id, params) {
|
|
|
51
50
|
if (params === null || params === void 0 ? void 0 : params.hasOwnProperty('limit')) {
|
|
52
51
|
queryParams += `&limit=${params === null || params === void 0 ? void 0 : params.limit}`;
|
|
53
52
|
}
|
|
54
|
-
const response = yield axiosInstance.get(`${GET_SET_SUPPLY(storeId)}/${id}/history?${queryParams}`, config);
|
|
53
|
+
const response = yield this.axiosInstance.get(`${GET_SET_SUPPLY(storeId)}/${id}/history?${queryParams}`, config);
|
|
55
54
|
return response;
|
|
56
55
|
}
|
|
57
56
|
catch (error) {
|
|
@@ -7,7 +7,6 @@ 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 axiosInstance from "../axiosInstance";
|
|
11
10
|
const GET_SET_SUPPLY = (storeId) => `api/store/${storeId}/supply`;
|
|
12
11
|
export const createSupply = function (storeId, data) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const createSupply = function (storeId, data) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.post(`${GET_SET_SUPPLY(storeId)}`, data, config);
|
|
17
|
+
const response = yield this.axiosInstance.post(`${GET_SET_SUPPLY(storeId)}`, data, config);
|
|
19
18
|
return response;
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
package/dist/api/supplies/put.js
CHANGED
|
@@ -7,7 +7,6 @@ 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 axiosInstance from "../axiosInstance";
|
|
11
10
|
const GET_SET_SUPPLY = (storeId) => `api/store/${storeId}/supply`;
|
|
12
11
|
export const updateSupplyById = function (storeId, id, data) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const updateSupplyById = function (storeId, id, data) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.put(`${GET_SET_SUPPLY(storeId)}/${id}`, data, config);
|
|
17
|
+
const response = yield this.axiosInstance.put(`${GET_SET_SUPPLY(storeId)}/${id}`, data, config);
|
|
19
18
|
return response;
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
@@ -30,7 +29,7 @@ export const addSupplyStock = function (storeId, id, data) {
|
|
|
30
29
|
const config = {
|
|
31
30
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
31
|
};
|
|
33
|
-
const response = yield axiosInstance.put(`${GET_SET_SUPPLY(storeId)}/${id}/addStock`, data, config);
|
|
32
|
+
const response = yield this.axiosInstance.put(`${GET_SET_SUPPLY(storeId)}/${id}/addStock`, data, config);
|
|
34
33
|
return response;
|
|
35
34
|
}
|
|
36
35
|
catch (error) {
|
package/dist/api/users/delete.js
CHANGED
|
@@ -7,7 +7,6 @@ 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 axiosInstance from "../axiosInstance";
|
|
11
10
|
const GET_SET_USER = 'api/user';
|
|
12
11
|
export const deleteUserById = function (id) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const deleteUserById = function (id) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.delete(`${GET_SET_USER}/${id}`, config);
|
|
17
|
+
const response = yield this.axiosInstance.delete(`${GET_SET_USER}/${id}`, config);
|
|
19
18
|
return response;
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
package/dist/api/users/post.js
CHANGED
|
@@ -7,7 +7,6 @@ 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 axiosInstance from "../axiosInstance";
|
|
11
10
|
const GET_SET_USER = 'api/users';
|
|
12
11
|
export const validateUserPin = function (data) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const validateUserPin = function (data) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
return yield axiosInstance.post(`${GET_SET_USER}/validate-pin`, data, config);
|
|
17
|
+
return yield this.axiosInstance.post(`${GET_SET_USER}/validate-pin`, data, config);
|
|
19
18
|
}
|
|
20
19
|
catch (error) {
|
|
21
20
|
console.error('Error fetching validateUserPin:', error);
|
package/dist/api/users/put.js
CHANGED
|
@@ -7,7 +7,6 @@ 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 axiosInstance from "../axiosInstance";
|
|
11
10
|
const GET_SET_USER = 'api/user';
|
|
12
11
|
const REQUEST_PARAMS = {
|
|
13
12
|
token: 'LOGGED_USER_TOKEN',
|
|
@@ -18,7 +17,7 @@ export const updateUserById = function (userId, data) {
|
|
|
18
17
|
const config = {
|
|
19
18
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
20
19
|
};
|
|
21
|
-
const response = yield axiosInstance.put(`${GET_SET_USER}/${userId}`, data, config);
|
|
20
|
+
const response = yield this.axiosInstance.put(`${GET_SET_USER}/${userId}`, data, config);
|
|
22
21
|
return response.data || {};
|
|
23
22
|
}
|
|
24
23
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -28,7 +28,7 @@ export const getHistory = async function (this: WashdayClientInstance, params: {
|
|
|
28
28
|
queryParams = queryParams.slice(0, -1);
|
|
29
29
|
|
|
30
30
|
const url = queryParams ? `${ATTENDANCE_API}/history?${queryParams}` : `${ATTENDANCE_API}/history`;
|
|
31
|
-
return await axiosInstance.get(url, config);
|
|
31
|
+
return await this.axiosInstance.get(url, config);
|
|
32
32
|
} catch (error) {
|
|
33
33
|
console.error('Error fetching attendance history:', error);
|
|
34
34
|
throw error;
|
|
@@ -52,7 +52,7 @@ export const getStatus = async function (this: WashdayClientInstance, params?: {
|
|
|
52
52
|
queryParams = queryParams.slice(0, -1);
|
|
53
53
|
|
|
54
54
|
const url = queryParams ? `${ATTENDANCE_API}/status?${queryParams}` : `${ATTENDANCE_API}/status`;
|
|
55
|
-
return await axiosInstance.get(url, config);
|
|
55
|
+
return await this.axiosInstance.get(url, config);
|
|
56
56
|
} catch (error) {
|
|
57
57
|
console.error('Error fetching attendance status:', error);
|
|
58
58
|
throw error;
|
|
@@ -82,7 +82,7 @@ export const getStoreReport = async function (this: WashdayClientInstance, store
|
|
|
82
82
|
queryParams = queryParams.slice(0, -1);
|
|
83
83
|
|
|
84
84
|
const url = queryParams ? `${ATTENDANCE_API}/store/${storeId}/report?${queryParams}` : `${ATTENDANCE_API}/store/${storeId}/report`;
|
|
85
|
-
return await axiosInstance.get(url, config);
|
|
85
|
+
return await this.axiosInstance.get(url, config);
|
|
86
86
|
} catch (error) {
|
|
87
87
|
console.error('Error fetching store attendance report:', error);
|
|
88
88
|
throw error;
|
|
@@ -115,7 +115,7 @@ export const exportStoreReport = async function (this: WashdayClientInstance, st
|
|
|
115
115
|
queryParams = queryParams.slice(0, -1);
|
|
116
116
|
|
|
117
117
|
const url = queryParams ? `${ATTENDANCE_API}/store/${storeId}/report/export?${queryParams}` : `${ATTENDANCE_API}/store/${storeId}/report/export`;
|
|
118
|
-
return await axiosInstance.get(url, config);
|
|
118
|
+
return await this.axiosInstance.get(url, config);
|
|
119
119
|
} catch (error) {
|
|
120
120
|
console.error('Error exporting store attendance report:', error);
|
|
121
121
|
throw error;
|
|
@@ -12,7 +12,7 @@ export const clockIn = async function (this: WashdayClientInstance, data: {
|
|
|
12
12
|
const config = {
|
|
13
13
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
14
14
|
};
|
|
15
|
-
return await axiosInstance.post(`${ATTENDANCE_API}/clock-in`, data, config);
|
|
15
|
+
return await this.axiosInstance.post(`${ATTENDANCE_API}/clock-in`, data, config);
|
|
16
16
|
} catch (error) {
|
|
17
17
|
console.error('Error clock-in:', error);
|
|
18
18
|
throw error;
|
|
@@ -28,7 +28,7 @@ export const clockOut = async function (this: WashdayClientInstance, data: {
|
|
|
28
28
|
const config = {
|
|
29
29
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
30
30
|
};
|
|
31
|
-
return await axiosInstance.post(`${ATTENDANCE_API}/clock-out`, data, config);
|
|
31
|
+
return await this.axiosInstance.post(`${ATTENDANCE_API}/clock-out`, data, config);
|
|
32
32
|
} catch (error) {
|
|
33
33
|
console.error('Error clock-out:', error);
|
|
34
34
|
throw error;
|
|
@@ -12,7 +12,7 @@ export const updateById = async function (this: WashdayClientInstance, id: strin
|
|
|
12
12
|
const config = {
|
|
13
13
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
14
14
|
};
|
|
15
|
-
return await axiosInstance.put(`${ATTENDANCE_API}/${id}`, data, config);
|
|
15
|
+
return await this.axiosInstance.put(`${ATTENDANCE_API}/${id}`, data, config);
|
|
16
16
|
} catch (error) {
|
|
17
17
|
console.error('Error updating attendance entry:', error);
|
|
18
18
|
throw error;
|
package/src/api/auth/post.ts
CHANGED
|
@@ -10,7 +10,7 @@ export const customerLoginToken = async function (this: WashdayClientInstance, p
|
|
|
10
10
|
}): Promise<any> {
|
|
11
11
|
try {
|
|
12
12
|
const config = {};
|
|
13
|
-
return await axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/tokenLogin`, params, config);
|
|
13
|
+
return await this.axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/tokenLogin`, params, config);
|
|
14
14
|
} catch (error) {
|
|
15
15
|
console.error('Error fetching customerLoginToken:', error);
|
|
16
16
|
throw error;
|
|
@@ -24,7 +24,7 @@ export const appleLogin = async function (this: WashdayClientInstance, params: {
|
|
|
24
24
|
}): Promise<any> {
|
|
25
25
|
try {
|
|
26
26
|
const config = {};
|
|
27
|
-
return await axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/apple`, params, config);
|
|
27
|
+
return await this.axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/apple`, params, config);
|
|
28
28
|
} catch (error) {
|
|
29
29
|
console.error('Error fetching appleLogin:', error);
|
|
30
30
|
throw error;
|
|
@@ -39,7 +39,7 @@ export const facebookLogin = async function (this: WashdayClientInstance, params
|
|
|
39
39
|
}): Promise<any> {
|
|
40
40
|
try {
|
|
41
41
|
const config = {};
|
|
42
|
-
return await axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/facebook`, params, config);
|
|
42
|
+
return await this.axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/facebook`, params, config);
|
|
43
43
|
} catch (error) {
|
|
44
44
|
console.error('Error fetching facebookLogin:', error);
|
|
45
45
|
throw error;
|
|
@@ -54,7 +54,7 @@ export const customerRegularLogin = async function (this: WashdayClientInstance,
|
|
|
54
54
|
}): Promise<any> {
|
|
55
55
|
try {
|
|
56
56
|
const config = {};
|
|
57
|
-
return await axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/login`, params, config);
|
|
57
|
+
return await this.axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/login`, params, config);
|
|
58
58
|
} catch (error) {
|
|
59
59
|
console.error('Error fetching customerRegularLogin:', error);
|
|
60
60
|
throw error;
|
|
@@ -71,7 +71,7 @@ export const customerSignUp = async function (this: WashdayClientInstance, param
|
|
|
71
71
|
}): Promise<any> {
|
|
72
72
|
try {
|
|
73
73
|
const config = {};
|
|
74
|
-
return await axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/signUp`, params, config);
|
|
74
|
+
return await this.axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/signUp`, params, config);
|
|
75
75
|
} catch (error) {
|
|
76
76
|
console.error('Error fetching customerSignUp:', error);
|
|
77
77
|
throw error;
|
|
@@ -91,7 +91,7 @@ export const googleLogin = async function (this: WashdayClientInstance, params:
|
|
|
91
91
|
}): Promise<any> {
|
|
92
92
|
try {
|
|
93
93
|
const config = {};
|
|
94
|
-
return await axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/google`, params, config);
|
|
94
|
+
return await this.axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/google`, params, config);
|
|
95
95
|
} catch (error) {
|
|
96
96
|
console.error('Error fetching googleLogin:', error);
|
|
97
97
|
throw error;
|
|
@@ -104,7 +104,7 @@ export const regularUserLogin = async function (this: WashdayClientInstance, par
|
|
|
104
104
|
}): Promise<any> {
|
|
105
105
|
try {
|
|
106
106
|
const config = {};
|
|
107
|
-
return await axiosInstance.post(`${REGULAR_USER_AUTH}/login`, params, config);
|
|
107
|
+
return await this.axiosInstance.post(`${REGULAR_USER_AUTH}/login`, params, config);
|
|
108
108
|
} catch (error) {
|
|
109
109
|
console.error('Error fetching regularUserLogin:', error);
|
|
110
110
|
throw error;
|
|
@@ -124,7 +124,7 @@ export const companySignUp = async function (this: WashdayClientInstance, params
|
|
|
124
124
|
}): Promise<any> {
|
|
125
125
|
try {
|
|
126
126
|
const config = {};
|
|
127
|
-
return await axiosInstance.post(`${REGULAR_USER_AUTH}/register`, params, config);
|
|
127
|
+
return await this.axiosInstance.post(`${REGULAR_USER_AUTH}/register`, params, config);
|
|
128
128
|
} catch (error) {
|
|
129
129
|
console.error('Error fetching companySignUp:', error);
|
|
130
130
|
throw error;
|
|
@@ -137,7 +137,7 @@ export const regularUserTokenLogin = async function (this: WashdayClientInstance
|
|
|
137
137
|
}): Promise<any> {
|
|
138
138
|
try {
|
|
139
139
|
const config = {};
|
|
140
|
-
return await axiosInstance.post(`${REGULAR_USER_AUTH}/tokenLogin`, params, config);
|
|
140
|
+
return await this.axiosInstance.post(`${REGULAR_USER_AUTH}/tokenLogin`, params, config);
|
|
141
141
|
} catch (error) {
|
|
142
142
|
console.error('Error fetching regularUserTokenLogin:', error);
|
|
143
143
|
throw error;
|
|
@@ -150,7 +150,7 @@ export const forgotPassword = async function (this: WashdayClientInstance, param
|
|
|
150
150
|
}): Promise<any> {
|
|
151
151
|
try {
|
|
152
152
|
const config = {};
|
|
153
|
-
return await axiosInstance.post(`${REGULAR_USER_AUTH}/forget-password`, params, config);
|
|
153
|
+
return await this.axiosInstance.post(`${REGULAR_USER_AUTH}/forget-password`, params, config);
|
|
154
154
|
} catch (error) {
|
|
155
155
|
console.error('Error fetching forgotPassword:', error);
|
|
156
156
|
throw error;
|
|
@@ -163,7 +163,7 @@ export const customersAppForgotPassword = async function (this: WashdayClientIns
|
|
|
163
163
|
}): Promise<any> {
|
|
164
164
|
try {
|
|
165
165
|
const config = {};
|
|
166
|
-
return await axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/${companyId}/forget-password`, params, config);
|
|
166
|
+
return await this.axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/${companyId}/forget-password`, params, config);
|
|
167
167
|
} catch (error) {
|
|
168
168
|
console.error('Error fetching customersAppForgotPassword:', error);
|
|
169
169
|
throw error;
|
|
@@ -176,7 +176,7 @@ export const customersAppChangePassword = async function (this: WashdayClientIns
|
|
|
176
176
|
}): Promise<any> {
|
|
177
177
|
try {
|
|
178
178
|
const config = {};
|
|
179
|
-
return await axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/change-password`, params, config);
|
|
179
|
+
return await this.axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/change-password`, params, config);
|
|
180
180
|
} catch (error) {
|
|
181
181
|
console.error('Error fetching customerSignUp:', error);
|
|
182
182
|
throw error;
|
|
@@ -190,7 +190,7 @@ export const pinLogin = async function (this: WashdayClientInstance, data: {
|
|
|
190
190
|
const config = {
|
|
191
191
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
192
192
|
};
|
|
193
|
-
return await axiosInstance.post(`${REGULAR_USER_AUTH}/pin-login`, data, config);
|
|
193
|
+
return await this.axiosInstance.post(`${REGULAR_USER_AUTH}/pin-login`, data, config);
|
|
194
194
|
} catch (error) {
|
|
195
195
|
console.error('Error fetching pinLogin:', error);
|
|
196
196
|
throw error;
|
package/src/api/axiosInstance.ts
CHANGED
|
@@ -4,51 +4,62 @@ import { v4 } from 'uuid';
|
|
|
4
4
|
// Define the type for the Axios instance
|
|
5
5
|
let axiosInstance: AxiosInstance | null = null;
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const DEV_BASE_URL: string = 'http://localhost:5555/';
|
|
8
|
+
const STAGE_BASE_URL: string = 'https://washday-backend-development.herokuapp.com/';
|
|
9
|
+
const PROD_BASE_URL: string = 'https://washday-backend.herokuapp.com/';
|
|
9
10
|
const BASE_URL: string = 'https://washday-backend.herokuapp.com/';
|
|
10
11
|
|
|
11
12
|
// Function to create or return the singleton instance
|
|
12
|
-
const getAxiosInstance = (): AxiosInstance => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
config.headers.Authorization = Authorization || `Bearer ${token}`;
|
|
33
|
-
}
|
|
34
|
-
if (contentType) {
|
|
35
|
-
config.headers['Content-Type'] = contentType;
|
|
36
|
-
}
|
|
37
|
-
if (responseType) {
|
|
38
|
-
config.responseType = responseType;
|
|
39
|
-
}
|
|
40
|
-
if (contentDisposition) {
|
|
41
|
-
config.headers['Content-Disposition'] = contentDisposition;
|
|
42
|
-
}
|
|
13
|
+
export const getAxiosInstance = (env: string = 'PROD'): AxiosInstance => {
|
|
14
|
+
let baseURL = BASE_URL;
|
|
15
|
+
switch (env) {
|
|
16
|
+
case 'DEV':
|
|
17
|
+
baseURL = DEV_BASE_URL;
|
|
18
|
+
break;
|
|
19
|
+
case 'STAGE':
|
|
20
|
+
baseURL = STAGE_BASE_URL;
|
|
21
|
+
break;
|
|
22
|
+
case 'PROD':
|
|
23
|
+
baseURL = PROD_BASE_URL;
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
axiosInstance = axios.create({
|
|
27
|
+
baseURL: baseURL,
|
|
28
|
+
headers: {
|
|
29
|
+
'Content-Type': 'application/json',
|
|
30
|
+
// Add any default headers here
|
|
31
|
+
},
|
|
32
|
+
});
|
|
43
33
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
// Add interceptor to set token and other options for every request
|
|
35
|
+
axiosInstance.interceptors.request.use(
|
|
36
|
+
(config) => {
|
|
37
|
+
const { token, responseType = 'json', contentDisposition } = config.params || {};
|
|
38
|
+
const { Authorization } = config.headers || {};
|
|
39
|
+
let contentType = config.headers['Content-Type'];
|
|
40
|
+
if (contentType === null || contentType === undefined) {
|
|
41
|
+
contentType = 'application/json';
|
|
49
42
|
}
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
if (Authorization || token) {
|
|
44
|
+
config.headers.Authorization = Authorization || `Bearer ${token}`;
|
|
45
|
+
}
|
|
46
|
+
if (contentType) {
|
|
47
|
+
config.headers['Content-Type'] = contentType;
|
|
48
|
+
}
|
|
49
|
+
if (responseType) {
|
|
50
|
+
config.responseType = responseType;
|
|
51
|
+
}
|
|
52
|
+
if (contentDisposition) {
|
|
53
|
+
config.headers['Content-Disposition'] = contentDisposition;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
config.headers['x-request-id'] = v4(); // used to track requests in the backend
|
|
57
|
+
return config;
|
|
58
|
+
},
|
|
59
|
+
(error) => {
|
|
60
|
+
return Promise.reject(error);
|
|
61
|
+
}
|
|
62
|
+
);
|
|
52
63
|
return axiosInstance;
|
|
53
64
|
};
|
|
54
65
|
|
|
@@ -8,7 +8,7 @@ export const deleteCashierBoxById = async function (this: WashdayClientInstance,
|
|
|
8
8
|
const config = {
|
|
9
9
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
10
10
|
};
|
|
11
|
-
return await axiosInstance.delete(`${GET_SET_CASHIER_BOX(storeId)}/${id}`, config);
|
|
11
|
+
return await this.axiosInstance.delete(`${GET_SET_CASHIER_BOX(storeId)}/${id}`, config);
|
|
12
12
|
} catch (error) {
|
|
13
13
|
console.error('Error fetching getStoreStaff:', error);
|
|
14
14
|
throw error;
|
|
@@ -20,7 +20,7 @@ export const deleteCashierBoxMovementById = async function (this: WashdayClientI
|
|
|
20
20
|
const config = {
|
|
21
21
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
22
22
|
};
|
|
23
|
-
return await axiosInstance.delete(`${GET_SET_CASHIER_BOX_MOVEMENT(storeId, cashierBoxId)}/${movementId}`, config);
|
|
23
|
+
return await this.axiosInstance.delete(`${GET_SET_CASHIER_BOX_MOVEMENT(storeId, cashierBoxId)}/${movementId}`, config);
|
|
24
24
|
} catch (error) {
|
|
25
25
|
console.error('Error fetching getStoreStaff:', error);
|
|
26
26
|
throw error;
|
|
@@ -8,7 +8,7 @@ export const getCashierboxesByStoreId = async function (this: WashdayClientInsta
|
|
|
8
8
|
const config = {
|
|
9
9
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
10
10
|
};
|
|
11
|
-
const response = await axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}?${queryParams || ''}`, config);
|
|
11
|
+
const response = await this.axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}?${queryParams || ''}`, config);
|
|
12
12
|
return response;
|
|
13
13
|
} catch (error) {
|
|
14
14
|
console.error('Error fetching getCashierboxesByStoreId:', error);
|
|
@@ -21,7 +21,7 @@ export const getCashierboxesById = async function (this: WashdayClientInstance,
|
|
|
21
21
|
const config = {
|
|
22
22
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
23
23
|
};
|
|
24
|
-
const response = await axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}/${id}?${queryParams}`, config);
|
|
24
|
+
const response = await this.axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}/${id}?${queryParams}`, config);
|
|
25
25
|
return response;
|
|
26
26
|
} catch (error) {
|
|
27
27
|
console.error('Error fetching getCashierboxesById:', error);
|
|
@@ -44,7 +44,7 @@ export const getCashierBoxMovementsHistory = async function (this: WashdayClient
|
|
|
44
44
|
if (params?.hasOwnProperty('limit')) {
|
|
45
45
|
queryParams += `&limit=${params?.limit}`
|
|
46
46
|
}
|
|
47
|
-
const response = await axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}/${id}/history?${queryParams}`, config);
|
|
47
|
+
const response = await this.axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}/${id}/history?${queryParams}`, config);
|
|
48
48
|
return response;
|
|
49
49
|
} catch (error) {
|
|
50
50
|
console.error('Error fetching getCashierBoxMovementsHistory:', error);
|
|
@@ -11,7 +11,7 @@ export const createCashierBox = async function (this: WashdayClientInstance, sto
|
|
|
11
11
|
const config = {
|
|
12
12
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
13
13
|
};
|
|
14
|
-
const response = await axiosInstance.post(`${GET_SET_CASHIER_BOX(storeId)}`, data, config);
|
|
14
|
+
const response = await this.axiosInstance.post(`${GET_SET_CASHIER_BOX(storeId)}`, data, config);
|
|
15
15
|
return response;
|
|
16
16
|
} catch (error) {
|
|
17
17
|
console.error('Error fetching getStoreStaff:', error);
|
|
@@ -30,7 +30,7 @@ export const addCashierBoxMovement = async function (this: WashdayClientInstance
|
|
|
30
30
|
const config = {
|
|
31
31
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
32
|
};
|
|
33
|
-
const response = await axiosInstance.post(`${GET_SET_CASHIER_BOX(storeId)}/${id}/add-movement`, data, config);
|
|
33
|
+
const response = await this.axiosInstance.post(`${GET_SET_CASHIER_BOX(storeId)}/${id}/add-movement`, data, config);
|
|
34
34
|
return response;
|
|
35
35
|
} catch (error) {
|
|
36
36
|
console.error('Error fetching createStoreImage:', error);
|
|
@@ -9,7 +9,7 @@ export const updateCashierBoxById = async function (this: WashdayClientInstance,
|
|
|
9
9
|
const config = {
|
|
10
10
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
11
11
|
};
|
|
12
|
-
const response = await axiosInstance.put(`${GET_SET_CASHIER_BOX(storeId)}/${id}`, data, config);
|
|
12
|
+
const response = await this.axiosInstance.put(`${GET_SET_CASHIER_BOX(storeId)}/${id}`, data, config);
|
|
13
13
|
return response;
|
|
14
14
|
} catch (error) {
|
|
15
15
|
console.error('Error fetching getStoreById:', error);
|
|
@@ -22,7 +22,7 @@ export const updateCashierBoxMovementById = async function (this: WashdayClientI
|
|
|
22
22
|
const config = {
|
|
23
23
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
24
24
|
};
|
|
25
|
-
const response = await axiosInstance.put(`${GET_SET_CASHIER_BOX_MOVEMENT(storeId, cashierBoxId)}/${id}`, data, config);
|
|
25
|
+
const response = await this.axiosInstance.put(`${GET_SET_CASHIER_BOX_MOVEMENT(storeId, cashierBoxId)}/${id}`, data, config);
|
|
26
26
|
return response;
|
|
27
27
|
} catch (error) {
|
|
28
28
|
console.error('Error fetching getStoreById:', error);
|
|
@@ -7,7 +7,7 @@ export const deleteCashUpReport = async function (this: WashdayClientInstance, s
|
|
|
7
7
|
const config = {
|
|
8
8
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
9
9
|
};
|
|
10
|
-
return await axiosInstance.delete(`${GET_CASH_UP_REPORTS}/${storeId}/${id}`, config);
|
|
10
|
+
return await this.axiosInstance.delete(`${GET_CASH_UP_REPORTS}/${storeId}/${id}`, config);
|
|
11
11
|
} catch (error) {
|
|
12
12
|
console.error('Error fetching:', error);
|
|
13
13
|
throw error;
|
package/src/api/cashups/get.ts
CHANGED
|
@@ -20,7 +20,7 @@ export const getList = async function (this: WashdayClientInstance, storeId: str
|
|
|
20
20
|
'limit',
|
|
21
21
|
'cashierBoxId'
|
|
22
22
|
], params);
|
|
23
|
-
return await axiosInstance.get(`${GET_CASH_UP_REPORTS}/${storeId}?${queryParams}`, config);
|
|
23
|
+
return await this.axiosInstance.get(`${GET_CASH_UP_REPORTS}/${storeId}?${queryParams}`, config);
|
|
24
24
|
} catch (error) {
|
|
25
25
|
console.error('Error fetching getList orders:', error);
|
|
26
26
|
throw error;
|
|
@@ -32,7 +32,7 @@ export const getById = async function (this: WashdayClientInstance, storeId: str
|
|
|
32
32
|
const config = {
|
|
33
33
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
34
34
|
};
|
|
35
|
-
return await axiosInstance.get(`${GET_CASH_UP_REPORTS}/${storeId}/${id}`, config);
|
|
35
|
+
return await this.axiosInstance.get(`${GET_CASH_UP_REPORTS}/${storeId}/${id}`, config);
|
|
36
36
|
} catch (error) {
|
|
37
37
|
console.error('Error fetching:', error);
|
|
38
38
|
throw error;
|
|
@@ -44,7 +44,7 @@ export const getPreviewDataForCashClose = async function (this: WashdayClientIns
|
|
|
44
44
|
const config = {
|
|
45
45
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
46
46
|
};
|
|
47
|
-
return await axiosInstance.get(`${GET_CASH_UP}/${storeId}/${id}`, config);
|
|
47
|
+
return await this.axiosInstance.get(`${GET_CASH_UP}/${storeId}/${id}`, config);
|
|
48
48
|
} catch (error) {
|
|
49
49
|
console.error('Error fetching:', error);
|
|
50
50
|
throw error;
|
package/src/api/cashups/post.ts
CHANGED
|
@@ -15,7 +15,7 @@ export const create = async function (this: WashdayClientInstance, storeId: stri
|
|
|
15
15
|
const config = {
|
|
16
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
17
|
};
|
|
18
|
-
return await axiosInstance.post(`${GET_CASH_UP}/${storeId}/${id}`, data, config);
|
|
18
|
+
return await this.axiosInstance.post(`${GET_CASH_UP}/${storeId}/${id}`, data, config);
|
|
19
19
|
} catch (error) {
|
|
20
20
|
console.error('Error fetching create:', error);
|
|
21
21
|
throw error;
|
package/src/api/cashups/put.ts
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
// const config = {
|
|
31
31
|
// headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
32
|
// };
|
|
33
|
-
// return await axiosInstance.put(`${GET_SET_ORDER}/${id}`, data, config);
|
|
33
|
+
// return await this.axiosInstance.put(`${GET_SET_ORDER}/${id}`, data, config);
|
|
34
34
|
// } catch (error) {
|
|
35
35
|
// console.error('Error fetching updateById:', error);
|
|
36
36
|
// throw error;
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
// const config = {
|
|
46
46
|
// headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
47
47
|
// };
|
|
48
|
-
// return await axiosInstance.put(`${GET_SET_ORDER_PAYMENTLINES(orderId)}/${id}`, data, config);
|
|
48
|
+
// return await this.axiosInstance.put(`${GET_SET_ORDER_PAYMENTLINES(orderId)}/${id}`, data, config);
|
|
49
49
|
// } catch (error) {
|
|
50
50
|
// console.error('Error fetching updateById:', error);
|
|
51
51
|
// throw error;
|
package/src/api/cfdi/delete.ts
CHANGED
|
@@ -10,7 +10,7 @@ export const cancelCFDI = async function (this: WashdayClientInstance, id: strin
|
|
|
10
10
|
const config = {
|
|
11
11
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
12
12
|
};
|
|
13
|
-
return await axiosInstance.delete(`${GET_SET_CFDI}/${id}`, {
|
|
13
|
+
return await this.axiosInstance.delete(`${GET_SET_CFDI}/${id}`, {
|
|
14
14
|
...config,
|
|
15
15
|
data
|
|
16
16
|
});
|