washday-sdk 1.6.0 → 1.6.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/companies/get.js +15 -3
- package/package.json +1 -1
- package/src/api/companies/get.ts +13 -7
|
@@ -8,9 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
const GET_SET_COMPANIES = 'api/company';
|
|
11
|
-
const REQUEST_PARAMS = {
|
|
12
|
-
token: 'LOGGED_USER_TOKEN',
|
|
13
|
-
};
|
|
14
11
|
export const getCompanyById = function (companyId) {
|
|
15
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
13
|
try {
|
|
@@ -26,3 +23,18 @@ export const getCompanyById = function (companyId) {
|
|
|
26
23
|
}
|
|
27
24
|
});
|
|
28
25
|
};
|
|
26
|
+
export const getCompanyOrdersMetrics = function () {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
try {
|
|
29
|
+
const config = {
|
|
30
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
31
|
+
};
|
|
32
|
+
const response = yield this.axiosInstance.get(`${GET_SET_COMPANIES}/metrics/orders`, config);
|
|
33
|
+
return response;
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
console.error('Error fetching getCompanyOrdersMetrics:', error);
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
};
|
package/package.json
CHANGED
package/src/api/companies/get.ts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
|
-
import { ICustomer } from "../../interfaces/Customer";
|
|
3
|
-
import { IOrderInfo } from "../../interfaces/Order";
|
|
4
|
-
import axiosInstance from "../axiosInstance";
|
|
5
2
|
|
|
6
3
|
const GET_SET_COMPANIES = 'api/company';
|
|
7
|
-
const REQUEST_PARAMS = {
|
|
8
|
-
token: 'LOGGED_USER_TOKEN',
|
|
9
|
-
};
|
|
10
|
-
|
|
11
4
|
|
|
12
5
|
export const getCompanyById = async function (this: WashdayClientInstance, companyId: string): Promise<any> {
|
|
13
6
|
try {
|
|
@@ -21,3 +14,16 @@ export const getCompanyById = async function (this: WashdayClientInstance, compa
|
|
|
21
14
|
throw error;
|
|
22
15
|
}
|
|
23
16
|
};
|
|
17
|
+
|
|
18
|
+
export const getCompanyOrdersMetrics = async function (this: WashdayClientInstance): Promise<any> {
|
|
19
|
+
try {
|
|
20
|
+
const config = {
|
|
21
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
22
|
+
};
|
|
23
|
+
const response = await this.axiosInstance.get(`${GET_SET_COMPANIES}/metrics/orders`, config);
|
|
24
|
+
return response;
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.error('Error fetching getCompanyOrdersMetrics:', error);
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
};
|