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/order/get.js
CHANGED
|
@@ -8,7 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { generateQueryParamsStr } from "../../utils/apiUtils";
|
|
11
|
-
import axiosInstance from "../axiosInstance";
|
|
12
11
|
const GET_SET_ORDER = 'api/v2/order';
|
|
13
12
|
const GET_SET_ORDER_CFDI = 'api/v2/orders';
|
|
14
13
|
const GET_HEADER_SUMMARY = 'api/orderHeaderSummary';
|
|
@@ -45,7 +44,7 @@ export const getList = function (params, options) {
|
|
|
45
44
|
'cfdiId',
|
|
46
45
|
], params);
|
|
47
46
|
// ], { ...params, q: params.q ? encodeURIComponent(params.q) : undefined });
|
|
48
|
-
return yield axiosInstance.get(`${GET_SET_ORDER}?${queryParams}`, config);
|
|
47
|
+
return yield this.axiosInstance.get(`${GET_SET_ORDER}?${queryParams}`, config);
|
|
49
48
|
}
|
|
50
49
|
catch (error) {
|
|
51
50
|
console.error('Error fetching getList orders:', error);
|
|
@@ -63,7 +62,7 @@ export const getOrdersHeaderSummary = function (params) {
|
|
|
63
62
|
'store',
|
|
64
63
|
'status',
|
|
65
64
|
], params);
|
|
66
|
-
return yield axiosInstance.get(`${GET_HEADER_SUMMARY}?${queryParams}`, config);
|
|
65
|
+
return yield this.axiosInstance.get(`${GET_HEADER_SUMMARY}?${queryParams}`, config);
|
|
67
66
|
}
|
|
68
67
|
catch (error) {
|
|
69
68
|
console.error('Error fetching getOrdersHeaderSummary :', error);
|
|
@@ -81,7 +80,7 @@ export const getById = function (id, params, options) {
|
|
|
81
80
|
const queryParams = generateQueryParamsStr([
|
|
82
81
|
'fetchSection',
|
|
83
82
|
], params);
|
|
84
|
-
return yield axiosInstance.get(`${GET_SET_ORDER}/${id}?${queryParams}`, config);
|
|
83
|
+
return yield this.axiosInstance.get(`${GET_SET_ORDER}/${id}?${queryParams}`, config);
|
|
85
84
|
}
|
|
86
85
|
catch (error) {
|
|
87
86
|
console.error('Error fetching:', error);
|
|
@@ -95,7 +94,7 @@ export const getCFDIOrdersByDateAndStore = function (id) {
|
|
|
95
94
|
const config = {
|
|
96
95
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
97
96
|
};
|
|
98
|
-
return yield axiosInstance.get(`${GET_SET_ORDER}/${id}`, config);
|
|
97
|
+
return yield this.axiosInstance.get(`${GET_SET_ORDER}/${id}`, config);
|
|
99
98
|
}
|
|
100
99
|
catch (error) {
|
|
101
100
|
console.error('Error fetching:', error);
|
|
@@ -115,7 +114,7 @@ export const fetchOrdersForCFDI = function (params) {
|
|
|
115
114
|
"storeID",
|
|
116
115
|
"customerID"
|
|
117
116
|
], params);
|
|
118
|
-
return yield axiosInstance.get(`${GET_SET_ORDER_CFDI}/cfdiPreview?${queryParams}`, config);
|
|
117
|
+
return yield this.axiosInstance.get(`${GET_SET_ORDER_CFDI}/cfdiPreview?${queryParams}`, config);
|
|
119
118
|
}
|
|
120
119
|
catch (error) {
|
|
121
120
|
console.error('Error fetching:', error);
|
|
@@ -143,7 +142,7 @@ export const getListCustomersApp = function (params) {
|
|
|
143
142
|
'readyDateTime',
|
|
144
143
|
'collectedDateTime',
|
|
145
144
|
], params);
|
|
146
|
-
return yield axiosInstance.get(`${GET_SET_ORDER_CUSTOMERS_APP}?${queryParams}`, config);
|
|
145
|
+
return yield this.axiosInstance.get(`${GET_SET_ORDER_CUSTOMERS_APP}?${queryParams}`, config);
|
|
147
146
|
}
|
|
148
147
|
catch (error) {
|
|
149
148
|
console.error('Error fetching getListCustomersApp orders:', error);
|
|
@@ -157,7 +156,7 @@ export const getByIdCustomersApp = function (id) {
|
|
|
157
156
|
const config = {
|
|
158
157
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
159
158
|
};
|
|
160
|
-
return yield axiosInstance.get(`${GET_SET_ORDER_CUSTOMERS_APP}/${id}`, config);
|
|
159
|
+
return yield this.axiosInstance.get(`${GET_SET_ORDER_CUSTOMERS_APP}/${id}`, config);
|
|
161
160
|
}
|
|
162
161
|
catch (error) {
|
|
163
162
|
console.error('Error fetching:', error);
|
|
@@ -171,7 +170,7 @@ export const getRequestedOrdersSummary = function (storeIds) {
|
|
|
171
170
|
const config = {
|
|
172
171
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
173
172
|
};
|
|
174
|
-
return yield axiosInstance.get(`${GET_SET_ORDER}/requested-summary?storeIds=${storeIds}`, config);
|
|
173
|
+
return yield this.axiosInstance.get(`${GET_SET_ORDER}/requested-summary?storeIds=${storeIds}`, config);
|
|
175
174
|
}
|
|
176
175
|
catch (error) {
|
|
177
176
|
console.error('Error fetching:', error);
|
package/dist/api/order/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_ORDER_PAYMENTLINES = (orderId) => `/api/v2/order/${orderId}/paymentLines`;
|
|
12
11
|
const GET_SET_ORDER = 'api/v2/order';
|
|
13
12
|
const GET_SET_ORDER_CUSTOMERS_APP = 'api/v2/washdayapp/orders';
|
|
@@ -17,7 +16,7 @@ export const createPaymentLine = function (id, data) {
|
|
|
17
16
|
const config = {
|
|
18
17
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
19
18
|
};
|
|
20
|
-
return yield axiosInstance.post(`${GET_SET_ORDER_PAYMENTLINES(id)}`, data, config);
|
|
19
|
+
return yield this.axiosInstance.post(`${GET_SET_ORDER_PAYMENTLINES(id)}`, data, config);
|
|
21
20
|
}
|
|
22
21
|
catch (error) {
|
|
23
22
|
console.error('Error fetching create:', error);
|
|
@@ -31,7 +30,7 @@ export const sendEmailReceipt = function (id) {
|
|
|
31
30
|
const config = {
|
|
32
31
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
33
32
|
};
|
|
34
|
-
return yield axiosInstance.post(`${GET_SET_ORDER}/${id}/sendEmailReceipt`, {}, config);
|
|
33
|
+
return yield this.axiosInstance.post(`${GET_SET_ORDER}/${id}/sendEmailReceipt`, {}, config);
|
|
35
34
|
}
|
|
36
35
|
catch (error) {
|
|
37
36
|
console.error('Error fetching create:', error);
|
|
@@ -45,7 +44,7 @@ export const createOrderCustomersApp = function (data) {
|
|
|
45
44
|
const config = {
|
|
46
45
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
47
46
|
};
|
|
48
|
-
return yield axiosInstance.post(`${GET_SET_ORDER_CUSTOMERS_APP}`, data, config);
|
|
47
|
+
return yield this.axiosInstance.post(`${GET_SET_ORDER_CUSTOMERS_APP}`, data, config);
|
|
49
48
|
}
|
|
50
49
|
catch (error) {
|
|
51
50
|
console.error('Error fetching createOrderCustomersApp:', error);
|
|
@@ -59,7 +58,7 @@ export const createOrderUsersApp = function (data) {
|
|
|
59
58
|
const config = {
|
|
60
59
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
61
60
|
};
|
|
62
|
-
return yield axiosInstance.post(`${GET_SET_ORDER}`, data, config);
|
|
61
|
+
return yield this.axiosInstance.post(`${GET_SET_ORDER}`, data, config);
|
|
63
62
|
}
|
|
64
63
|
catch (error) {
|
|
65
64
|
console.error('Error fetching createOrderUsersApp:', error);
|
|
@@ -73,7 +72,7 @@ export const bulkCreatePaymentLines = function (storeId, body) {
|
|
|
73
72
|
const config = {
|
|
74
73
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
75
74
|
};
|
|
76
|
-
return yield axiosInstance.post(`${GET_SET_ORDER}/${storeId}/bulkPaymentLines`, body, config);
|
|
75
|
+
return yield this.axiosInstance.post(`${GET_SET_ORDER}/${storeId}/bulkPaymentLines`, body, config);
|
|
77
76
|
}
|
|
78
77
|
catch (error) {
|
|
79
78
|
console.error('Error fetching bulkCreatePaymentLines:', error);
|
|
@@ -91,7 +90,7 @@ export const createOrderEvidence = function (orderId, data) {
|
|
|
91
90
|
'Content-Type': false
|
|
92
91
|
}
|
|
93
92
|
};
|
|
94
|
-
return yield axiosInstance.post(`${GET_SET_ORDER}/${orderId}/evidence`, data, config);
|
|
93
|
+
return yield this.axiosInstance.post(`${GET_SET_ORDER}/${orderId}/evidence`, data, config);
|
|
95
94
|
}
|
|
96
95
|
catch (error) {
|
|
97
96
|
console.error('Error fetching createOrderEvidence:', error);
|
|
@@ -105,7 +104,7 @@ export const getRedeemPointsPreview = function (data) {
|
|
|
105
104
|
const config = {
|
|
106
105
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
107
106
|
};
|
|
108
|
-
return yield axiosInstance.post(`${GET_SET_ORDER}/redeemPointsPreview`, data, config);
|
|
107
|
+
return yield this.axiosInstance.post(`${GET_SET_ORDER}/redeemPointsPreview`, data, config);
|
|
109
108
|
}
|
|
110
109
|
catch (error) {
|
|
111
110
|
console.error('Error fetching getRedeemPointsPreview:', error);
|
package/dist/api/order/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
|
import { generateQueryParamsStr } from "../../utils/apiUtils";
|
|
12
11
|
const GET_SET_ORDER = 'api/v2/order';
|
|
13
12
|
const GET_SET_ORDER_OLD = 'api/order';
|
|
@@ -18,7 +17,7 @@ export const updateById = function (id, data) {
|
|
|
18
17
|
const config = {
|
|
19
18
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
20
19
|
};
|
|
21
|
-
return yield axiosInstance.put(`${GET_SET_ORDER}/${id}`, data, config);
|
|
20
|
+
return yield this.axiosInstance.put(`${GET_SET_ORDER}/${id}`, data, config);
|
|
22
21
|
}
|
|
23
22
|
catch (error) {
|
|
24
23
|
console.error('Error fetching updateById:', error);
|
|
@@ -32,7 +31,7 @@ export const updatePaymentLineById = function (orderId, id, data) {
|
|
|
32
31
|
const config = {
|
|
33
32
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
34
33
|
};
|
|
35
|
-
return yield axiosInstance.put(`${GET_SET_ORDER_PAYMENTLINES(orderId)}/${id}`, data, config);
|
|
34
|
+
return yield this.axiosInstance.put(`${GET_SET_ORDER_PAYMENTLINES(orderId)}/${id}`, data, config);
|
|
36
35
|
}
|
|
37
36
|
catch (error) {
|
|
38
37
|
console.error('Error fetching updateById:', error);
|
|
@@ -46,7 +45,7 @@ export const setOrderCancelledBySequence = function (sequence, storeId, data) {
|
|
|
46
45
|
const config = {
|
|
47
46
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
48
47
|
};
|
|
49
|
-
return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cancelled`, data, config);
|
|
48
|
+
return yield this.axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cancelled`, data, config);
|
|
50
49
|
}
|
|
51
50
|
catch (error) {
|
|
52
51
|
console.error('Error fetching setOrderCancelledBySequence:', error);
|
|
@@ -60,7 +59,7 @@ export const setOrderCleaningBySequence = function (sequence, storeId) {
|
|
|
60
59
|
const config = {
|
|
61
60
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
62
61
|
};
|
|
63
|
-
return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cleaning`, {}, config);
|
|
62
|
+
return yield this.axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cleaning`, {}, config);
|
|
64
63
|
}
|
|
65
64
|
catch (error) {
|
|
66
65
|
console.error('Error fetching setOrderCleaningBySequence:', error);
|
|
@@ -77,7 +76,7 @@ export const setOrderCleanedBySequence = function (sequence, storeId, data, para
|
|
|
77
76
|
const queryParams = generateQueryParamsStr([
|
|
78
77
|
'markOutsourcedAsReturned',
|
|
79
78
|
], params);
|
|
80
|
-
return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cleaned?${queryParams}`, data, config);
|
|
79
|
+
return yield this.axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cleaned?${queryParams}`, data, config);
|
|
81
80
|
}
|
|
82
81
|
catch (error) {
|
|
83
82
|
console.error('Error fetching setOrderCleanedBySequence:', error);
|
|
@@ -91,7 +90,7 @@ export const setOrderCollectedBySequence = function (sequence, storeId, data) {
|
|
|
91
90
|
const config = {
|
|
92
91
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
93
92
|
};
|
|
94
|
-
return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/collected`, data, config);
|
|
93
|
+
return yield this.axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/collected`, data, config);
|
|
95
94
|
}
|
|
96
95
|
catch (error) {
|
|
97
96
|
console.error('Error fetching setOrderCollectedBySequence:', error);
|
|
@@ -105,7 +104,7 @@ export const setOrdePickingBySequence = function (sequence, storeId, data) {
|
|
|
105
104
|
const config = {
|
|
106
105
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
107
106
|
};
|
|
108
|
-
return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/picking`, data, config);
|
|
107
|
+
return yield this.axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/picking`, data, config);
|
|
109
108
|
}
|
|
110
109
|
catch (error) {
|
|
111
110
|
console.error('Error fetching setOrdePickingBySequence:', error);
|
|
@@ -119,7 +118,7 @@ export const setOrdeDeliveringBySequence = function (sequence, storeId, data) {
|
|
|
119
118
|
const config = {
|
|
120
119
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
121
120
|
};
|
|
122
|
-
return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/delivering`, data, config);
|
|
121
|
+
return yield this.axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/delivering`, data, config);
|
|
123
122
|
}
|
|
124
123
|
catch (error) {
|
|
125
124
|
console.error('Error fetching setOrdeDeliveringBySequence:', error);
|
|
@@ -133,7 +132,7 @@ export const setOrdeDeliveredBySequence = function (sequence, storeId, data) {
|
|
|
133
132
|
const config = {
|
|
134
133
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
135
134
|
};
|
|
136
|
-
return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/delivered`, data, config);
|
|
135
|
+
return yield this.axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/delivered`, data, config);
|
|
137
136
|
}
|
|
138
137
|
catch (error) {
|
|
139
138
|
console.error('Error fetching setOrdeDeliveredBySequence:', error);
|
|
@@ -147,7 +146,7 @@ export const setOrderAcceptedBySequence = function (sequence, storeId) {
|
|
|
147
146
|
const config = {
|
|
148
147
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
149
148
|
};
|
|
150
|
-
return yield axiosInstance.put(`${GET_SET_ORDER}/${sequence}/${storeId}/accepted`, {}, config);
|
|
149
|
+
return yield this.axiosInstance.put(`${GET_SET_ORDER}/${sequence}/${storeId}/accepted`, {}, config);
|
|
151
150
|
}
|
|
152
151
|
catch (error) {
|
|
153
152
|
console.error('Error fetching setOrderAcceptedBySequence:', error);
|
|
@@ -161,7 +160,7 @@ export const bulkCancel = function (storeId, body) {
|
|
|
161
160
|
const config = {
|
|
162
161
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
163
162
|
};
|
|
164
|
-
return yield axiosInstance.put(`${GET_SET_ORDER}/${storeId}/bulkCancel`, body, config);
|
|
163
|
+
return yield this.axiosInstance.put(`${GET_SET_ORDER}/${storeId}/bulkCancel`, body, config);
|
|
165
164
|
}
|
|
166
165
|
catch (error) {
|
|
167
166
|
console.error('Error fetching bulkCancel:', error);
|
|
@@ -178,7 +177,7 @@ export const bulkClean = function (storeId, body, params) {
|
|
|
178
177
|
const queryParams = generateQueryParamsStr([
|
|
179
178
|
'markOutsourcedAsReturned',
|
|
180
179
|
], params);
|
|
181
|
-
return yield axiosInstance.put(`${GET_SET_ORDER}/${storeId}/bulkClean?${queryParams}`, body, config);
|
|
180
|
+
return yield this.axiosInstance.put(`${GET_SET_ORDER}/${storeId}/bulkClean?${queryParams}`, body, config);
|
|
182
181
|
}
|
|
183
182
|
catch (error) {
|
|
184
183
|
console.error('Error fetching bulkClean:', error);
|
|
@@ -192,7 +191,7 @@ export const bulkCollect = function (storeId, body) {
|
|
|
192
191
|
const config = {
|
|
193
192
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
194
193
|
};
|
|
195
|
-
return yield axiosInstance.put(`${GET_SET_ORDER}/${storeId}/bulkCollect`, body, config);
|
|
194
|
+
return yield this.axiosInstance.put(`${GET_SET_ORDER}/${storeId}/bulkCollect`, body, config);
|
|
196
195
|
}
|
|
197
196
|
catch (error) {
|
|
198
197
|
console.error('Error fetching bulkCollect:', 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_OUTSOURCED_ORDERS = 'api/outsourced-orders';
|
|
12
11
|
export const deleteOutsourcedOrderById = function (id) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const deleteOutsourcedOrderById = function (id) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
return yield axiosInstance.delete(`${GET_SET_OUTSOURCED_ORDERS}/${id}`, config);
|
|
17
|
+
return yield this.axiosInstance.delete(`${GET_SET_OUTSOURCED_ORDERS}/${id}`, config);
|
|
19
18
|
}
|
|
20
19
|
catch (error) {
|
|
21
20
|
console.error('Error fetching deleteOutsourcedOrderById:', error);
|
|
@@ -8,7 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { generateQueryParamsStr } from "../../utils/apiUtils";
|
|
11
|
-
import axiosInstance from "../axiosInstance";
|
|
12
11
|
const GET_OUTSOURCED_ORDERS_BY_STORE = 'api/store/:storeId/outsourced-orders';
|
|
13
12
|
const GET_OUTSOURCED_ORDERS_BY_ORDER = 'api/orders/:orderId/outsourced-orders';
|
|
14
13
|
const GET_SET_OUTSOURCED_ORDERS = 'api/outsourced-orders';
|
|
@@ -18,7 +17,7 @@ export const getOutsourcedOrdersByOrder = function (orderId) {
|
|
|
18
17
|
const config = {
|
|
19
18
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
20
19
|
};
|
|
21
|
-
return yield axiosInstance.get(`${GET_OUTSOURCED_ORDERS_BY_ORDER.replace(':orderId', orderId)}`, config);
|
|
20
|
+
return yield this.axiosInstance.get(`${GET_OUTSOURCED_ORDERS_BY_ORDER.replace(':orderId', orderId)}`, config);
|
|
22
21
|
}
|
|
23
22
|
catch (error) {
|
|
24
23
|
console.error('Error fetching getOutsourcedOrdersByOrder:', error);
|
|
@@ -38,7 +37,7 @@ export const getOutsourcedOrdersByStore = function (params) {
|
|
|
38
37
|
'limit',
|
|
39
38
|
'sequence'
|
|
40
39
|
], params);
|
|
41
|
-
return yield axiosInstance.get(`${GET_OUTSOURCED_ORDERS_BY_STORE.replace(':storeId', params.storeId)}?${queryParams}`, config);
|
|
40
|
+
return yield this.axiosInstance.get(`${GET_OUTSOURCED_ORDERS_BY_STORE.replace(':storeId', params.storeId)}?${queryParams}`, config);
|
|
42
41
|
}
|
|
43
42
|
catch (error) {
|
|
44
43
|
console.error('Error fetching getOutsourcedOrdersByStore:', error);
|
|
@@ -52,7 +51,7 @@ export const getOutsourcedOrderById = function (id) {
|
|
|
52
51
|
const config = {
|
|
53
52
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
54
53
|
};
|
|
55
|
-
return yield axiosInstance.get(`${GET_SET_OUTSOURCED_ORDERS}/${id}`, config);
|
|
54
|
+
return yield this.axiosInstance.get(`${GET_SET_OUTSOURCED_ORDERS}/${id}`, config);
|
|
56
55
|
}
|
|
57
56
|
catch (error) {
|
|
58
57
|
console.error('Error fetching getOutsourcedOrderById:', 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_OUTSOURCED_ORDERS = 'api/outsourced-orders';
|
|
12
11
|
export const createOutsourcedOrder = function (data) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const createOutsourcedOrder = function (data) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
return yield axiosInstance.post(GET_SET_OUTSOURCED_ORDERS, data, config);
|
|
17
|
+
return yield this.axiosInstance.post(GET_SET_OUTSOURCED_ORDERS, data, config);
|
|
19
18
|
}
|
|
20
19
|
catch (error) {
|
|
21
20
|
console.error('Error fetching createOutsourcedOrder:', 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_OUTSOURCED_ORDERS = 'api/outsourced-orders';
|
|
12
11
|
export const updateOutsourcedOrderById = function (id, data) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const updateOutsourcedOrderById = function (id, data) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
return yield axiosInstance.put(`${GET_SET_OUTSOURCED_ORDERS}/${id}`, data, config);
|
|
17
|
+
return yield this.axiosInstance.put(`${GET_SET_OUTSOURCED_ORDERS}/${id}`, data, config);
|
|
19
18
|
}
|
|
20
19
|
catch (error) {
|
|
21
20
|
console.error('Error fetching updateOutsourcedOrderById:', 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_PARTNERS = 'api/partners';
|
|
12
11
|
export const deletePartnerById = function (id) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const deletePartnerById = function (id) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
return yield axiosInstance.delete(`${GET_SET_PARTNERS}/${id}`, config);
|
|
17
|
+
return yield this.axiosInstance.delete(`${GET_SET_PARTNERS}/${id}`, config);
|
|
19
18
|
}
|
|
20
19
|
catch (error) {
|
|
21
20
|
console.error('Error fetching deletePartnerById:', error);
|
package/dist/api/partners/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_PARTNERS = 'api/partners';
|
|
12
11
|
export const getPartners = function () {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -16,7 +15,7 @@ export const getPartners = function () {
|
|
|
16
15
|
const config = {
|
|
17
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
18
17
|
};
|
|
19
|
-
return yield axiosInstance.get(`${GET_SET_PARTNERS}`, config);
|
|
18
|
+
return yield this.axiosInstance.get(`${GET_SET_PARTNERS}`, config);
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
22
21
|
console.error('Error fetching getPartners:', error);
|
|
@@ -30,7 +29,7 @@ export const getPartnerById = function (id) {
|
|
|
30
29
|
const config = {
|
|
31
30
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
31
|
};
|
|
33
|
-
return yield axiosInstance.get(`${GET_SET_PARTNERS}/${id}`, config);
|
|
32
|
+
return yield this.axiosInstance.get(`${GET_SET_PARTNERS}/${id}`, config);
|
|
34
33
|
}
|
|
35
34
|
catch (error) {
|
|
36
35
|
console.error('Error fetching getPartnerById:', 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_PARTNERS = 'api/partners';
|
|
12
11
|
export const createPartner = function (data) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const createPartner = function (data) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
return yield axiosInstance.post(GET_SET_PARTNERS, data, config);
|
|
17
|
+
return yield this.axiosInstance.post(GET_SET_PARTNERS, data, config);
|
|
19
18
|
}
|
|
20
19
|
catch (error) {
|
|
21
20
|
console.error('Error fetching createPartner:', error);
|
package/dist/api/partners/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_PARTNERS = 'api/partners';
|
|
12
11
|
export const updatePartnerById = function (id, data) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const updatePartnerById = function (id, data) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
return yield axiosInstance.put(`${GET_SET_PARTNERS}/${id}`, data, config);
|
|
17
|
+
return yield this.axiosInstance.put(`${GET_SET_PARTNERS}/${id}`, data, config);
|
|
19
18
|
}
|
|
20
19
|
catch (error) {
|
|
21
20
|
console.error('Error fetching updatePartnerById:', error);
|
package/dist/api/pdf/get.js
CHANGED
|
@@ -8,7 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { generateQueryParamsStr } from "../../utils/apiUtils";
|
|
11
|
-
import axiosInstance from "../axiosInstance";
|
|
12
11
|
const GENERATE_EXPORT = 'api/export';
|
|
13
12
|
const GET_SET_REPORTS = 'api/reports';
|
|
14
13
|
export const exportUnpaidOrdersReportPDF = function (storeId, params) {
|
|
@@ -24,7 +23,7 @@ export const exportUnpaidOrdersReportPDF = function (storeId, params) {
|
|
|
24
23
|
// responseType: 'blob', // Important for handling the PDF blob response
|
|
25
24
|
};
|
|
26
25
|
const queryParams = generateQueryParamsStr(['store', 'fromDate', 'toDate', 'timezone', 'customerName'], params);
|
|
27
|
-
return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/unpaidOrders/export/pdf?${queryParams}`, config);
|
|
26
|
+
return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/unpaidOrders/export/pdf?${queryParams}`, config);
|
|
28
27
|
// // Create a link element, trigger a download
|
|
29
28
|
// const url = window.URL.createObjectURL(new Blob([response.data]));
|
|
30
29
|
// const link = document.createElement('a');
|
|
@@ -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_PRODUCTS = 'api/product';
|
|
12
11
|
const GET_SET_PRODUCTS_SUPPLY = 'api/product-supply';
|
|
13
12
|
export const deleteById = function (id) {
|
|
@@ -16,7 +15,7 @@ export const deleteById = function (id) {
|
|
|
16
15
|
const config = {
|
|
17
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
18
17
|
};
|
|
19
|
-
return yield axiosInstance.delete(`${GET_SET_PRODUCTS}/${id}`, config);
|
|
18
|
+
return yield this.axiosInstance.delete(`${GET_SET_PRODUCTS}/${id}`, config);
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
22
21
|
console.error('Error fetching deleteById:', error);
|
|
@@ -30,7 +29,7 @@ export const deleteProductSupplyById = function (id, productSupplyId) {
|
|
|
30
29
|
const config = {
|
|
31
30
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
31
|
};
|
|
33
|
-
return yield axiosInstance.delete(`${GET_SET_PRODUCTS_SUPPLY}/${id}/${productSupplyId}`, config);
|
|
32
|
+
return yield this.axiosInstance.delete(`${GET_SET_PRODUCTS_SUPPLY}/${id}/${productSupplyId}`, config);
|
|
34
33
|
}
|
|
35
34
|
catch (error) {
|
|
36
35
|
console.error('Error fetching deleteProductSupplyById:', error);
|
|
@@ -45,7 +44,7 @@ export const deletePriceOption = function (productId, optionId) {
|
|
|
45
44
|
const config = {
|
|
46
45
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
47
46
|
};
|
|
48
|
-
const response = yield axiosInstance.delete(`${GET_SET_PRODUCTS}/${productId}/price-options/${optionId}`, config);
|
|
47
|
+
const response = yield this.axiosInstance.delete(`${GET_SET_PRODUCTS}/${productId}/price-options/${optionId}`, config);
|
|
49
48
|
return response.data || {};
|
|
50
49
|
}
|
|
51
50
|
catch (error) {
|
package/dist/api/products/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_PRODUCTS = 'api/product';
|
|
12
11
|
export const getById = function (id) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const getById = function (id) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
return yield axiosInstance.get(`${GET_SET_PRODUCTS}/${id}`, config);
|
|
17
|
+
return yield this.axiosInstance.get(`${GET_SET_PRODUCTS}/${id}`, config);
|
|
19
18
|
}
|
|
20
19
|
catch (error) {
|
|
21
20
|
console.error('Error fetching getById:', 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_PRODUCTS_SUPPLY = 'api/product-supply';
|
|
12
11
|
const GET_SET_PRODUCTS = 'api/product';
|
|
13
12
|
export const create = function (data) {
|
|
@@ -16,7 +15,7 @@ export const create = function (data) {
|
|
|
16
15
|
const config = {
|
|
17
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
18
17
|
};
|
|
19
|
-
const response = yield axiosInstance.post(`${GET_SET_PRODUCTS}`, data, config);
|
|
18
|
+
const response = yield this.axiosInstance.post(`${GET_SET_PRODUCTS}`, data, config);
|
|
20
19
|
return response;
|
|
21
20
|
}
|
|
22
21
|
catch (error) {
|
|
@@ -31,7 +30,7 @@ export const createProductSupply = function (id, data) {
|
|
|
31
30
|
const config = {
|
|
32
31
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
33
32
|
};
|
|
34
|
-
const response = yield axiosInstance.post(`${GET_SET_PRODUCTS_SUPPLY}/${id}`, data, config);
|
|
33
|
+
const response = yield this.axiosInstance.post(`${GET_SET_PRODUCTS_SUPPLY}/${id}`, data, config);
|
|
35
34
|
return response;
|
|
36
35
|
}
|
|
37
36
|
catch (error) {
|
|
@@ -49,7 +48,7 @@ export const bulkCreate = function (storeId, data) {
|
|
|
49
48
|
'Content-Type': 'multipart/form-data' // Let axios handle the boundary
|
|
50
49
|
}
|
|
51
50
|
};
|
|
52
|
-
const response = yield axiosInstance.post(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
51
|
+
const response = yield this.axiosInstance.post(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
53
52
|
return response.data || {};
|
|
54
53
|
}
|
|
55
54
|
catch (error) {
|
|
@@ -65,7 +64,7 @@ export const createPriceOption = function (productId, data) {
|
|
|
65
64
|
const config = {
|
|
66
65
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
67
66
|
};
|
|
68
|
-
const response = yield axiosInstance.post(`${GET_SET_PRODUCTS}/${productId}/price-options`, data, config);
|
|
67
|
+
const response = yield this.axiosInstance.post(`${GET_SET_PRODUCTS}/${productId}/price-options`, data, config);
|
|
69
68
|
return response.data || {};
|
|
70
69
|
}
|
|
71
70
|
catch (error) {
|
package/dist/api/products/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_PRODUCTS = 'api/product';
|
|
12
11
|
export const bulkUpdate = function (storeId, data) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const bulkUpdate = function (storeId, data) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.put(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
17
|
+
const response = yield this.axiosInstance.put(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
19
18
|
return response.data || {};
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
@@ -30,7 +29,7 @@ export const updateById = function (id, data) {
|
|
|
30
29
|
const config = {
|
|
31
30
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
31
|
};
|
|
33
|
-
return yield axiosInstance.put(`${GET_SET_PRODUCTS}/${id}`, data, config);
|
|
32
|
+
return yield this.axiosInstance.put(`${GET_SET_PRODUCTS}/${id}`, data, config);
|
|
34
33
|
}
|
|
35
34
|
catch (error) {
|
|
36
35
|
console.error('Error fetching updateById:', error);
|
|
@@ -45,7 +44,7 @@ export const updatePriceOption = function (productId, optionId, data) {
|
|
|
45
44
|
const config = {
|
|
46
45
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
47
46
|
};
|
|
48
|
-
const response = yield axiosInstance.put(`${GET_SET_PRODUCTS}/${productId}/price-options/${optionId}`, data, config);
|
|
47
|
+
const response = yield this.axiosInstance.put(`${GET_SET_PRODUCTS}/${productId}/price-options/${optionId}`, data, config);
|
|
49
48
|
return response.data || {};
|
|
50
49
|
}
|
|
51
50
|
catch (error) {
|
package/dist/api/publics/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_PUBLIC = '/api/public';
|
|
12
11
|
const GET_PUBLIC_ORDERS_ROUTES = '/api/public/orders';
|
|
13
12
|
export const getOrderPublicReceipt = function (orderPublicToken) {
|
|
@@ -16,7 +15,7 @@ export const getOrderPublicReceipt = function (orderPublicToken) {
|
|
|
16
15
|
const config = {
|
|
17
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
18
17
|
};
|
|
19
|
-
return yield axiosInstance.get(`${GET_PUBLIC_ORDERS_ROUTES}/${orderPublicToken}/receipt`, config);
|
|
18
|
+
return yield this.axiosInstance.get(`${GET_PUBLIC_ORDERS_ROUTES}/${orderPublicToken}/receipt`, config);
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
22
21
|
console.error('Error fetching getOrderPublicReceipt:', error);
|