@stackfactor/client-api 1.0.61 → 1.0.63
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/lib/axiosClient.js +3 -2
- package/lib/skillTemplate.js +3 -8
- package/package.json +1 -1
package/lib/axiosClient.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
|
+
import { RESPONSE_TYPE } from "./constants.js";
|
|
2
3
|
import https from "https";
|
|
3
4
|
import utils from "./utils.js";
|
|
4
5
|
|
|
@@ -47,7 +48,7 @@ const errorToString = (error) => {
|
|
|
47
48
|
const getErrorType = (error) => {
|
|
48
49
|
if (error?.response?.status) {
|
|
49
50
|
return error.response.status;
|
|
50
|
-
} else return
|
|
51
|
+
} else return RESPONSE_TYPE.SERVICE_UNAVAILABLE;
|
|
51
52
|
};
|
|
52
53
|
|
|
53
54
|
/**
|
|
@@ -68,7 +69,7 @@ const getErrorInformation = (error) => {
|
|
|
68
69
|
* @param {Object} error - The error returned by the server
|
|
69
70
|
*/
|
|
70
71
|
const shouldReturnError = (returnAllExceptions, error) => {
|
|
71
|
-
if (getErrorType(error) ===
|
|
72
|
+
if (getErrorType(error) === RESPONSE_TYPE.UNAUTHORIZED) {
|
|
72
73
|
return returnAllExceptions;
|
|
73
74
|
} else {
|
|
74
75
|
return true;
|
package/lib/skillTemplate.js
CHANGED
|
@@ -137,14 +137,9 @@ export const getSkillTemplateList = (
|
|
|
137
137
|
*/
|
|
138
138
|
export const getTechnologyStacks = (token) => {
|
|
139
139
|
return new Promise(function (resolve, reject) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
requestData,
|
|
144
|
-
{
|
|
145
|
-
headers: { authorization: token },
|
|
146
|
-
}
|
|
147
|
-
);
|
|
140
|
+
let confirmationRequest = client.get(`api/v1/skilltemplates/stacks`, {
|
|
141
|
+
headers: { authorization: token },
|
|
142
|
+
});
|
|
148
143
|
confirmationRequest
|
|
149
144
|
.then((response) => {
|
|
150
145
|
resolve(response.data);
|