cemiar-epic-service-common 1.0.115 → 1.0.116
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.
|
@@ -19,7 +19,10 @@ class BaseEpicService {
|
|
|
19
19
|
return axiosResponse.result;
|
|
20
20
|
}
|
|
21
21
|
catch (error) {
|
|
22
|
-
|
|
22
|
+
if (error.response && error.response.data) {
|
|
23
|
+
throw this.handleError(error.response.data);
|
|
24
|
+
}
|
|
25
|
+
throw new Error(error.message);
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
async getOne(endpoint, id, queryParams = {}) {
|
|
@@ -36,7 +39,10 @@ class BaseEpicService {
|
|
|
36
39
|
return axiosResponse.result;
|
|
37
40
|
}
|
|
38
41
|
catch (error) {
|
|
39
|
-
|
|
42
|
+
if (error.response && error.response.data) {
|
|
43
|
+
throw this.handleError(error.response.data);
|
|
44
|
+
}
|
|
45
|
+
throw new Error(error.message);
|
|
40
46
|
}
|
|
41
47
|
}
|
|
42
48
|
async put(endpoint, data, queryParams = {}) {
|
|
@@ -51,7 +57,10 @@ class BaseEpicService {
|
|
|
51
57
|
return axiosResponse.result.split(':')[1];
|
|
52
58
|
}
|
|
53
59
|
catch (error) {
|
|
54
|
-
|
|
60
|
+
if (error.response && error.response.data) {
|
|
61
|
+
throw this.handleError(error.response.data);
|
|
62
|
+
}
|
|
63
|
+
throw new Error(error.message);
|
|
55
64
|
}
|
|
56
65
|
}
|
|
57
66
|
async post(endpoint, data) {
|
|
@@ -65,7 +74,10 @@ class BaseEpicService {
|
|
|
65
74
|
return responseArray;
|
|
66
75
|
}
|
|
67
76
|
catch (error) {
|
|
68
|
-
|
|
77
|
+
if (error.response && error.response.data) {
|
|
78
|
+
throw this.handleError(error.response.data);
|
|
79
|
+
}
|
|
80
|
+
throw new Error(error.message);
|
|
69
81
|
}
|
|
70
82
|
}
|
|
71
83
|
async delete(endpoint, id) {
|
|
@@ -75,7 +87,10 @@ class BaseEpicService {
|
|
|
75
87
|
return axiosResponse.result;
|
|
76
88
|
}
|
|
77
89
|
catch (error) {
|
|
78
|
-
|
|
90
|
+
if (error.response && error.response.data) {
|
|
91
|
+
throw this.handleError(error.response.data);
|
|
92
|
+
}
|
|
93
|
+
throw new Error(error.message);
|
|
79
94
|
}
|
|
80
95
|
}
|
|
81
96
|
buildQueryString(queryParams) {
|