@stackfactor/client-api 1.0.31 → 1.0.33

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.
@@ -1,89 +1,101 @@
1
- import { axios } from "./axiosClient";
1
+ import axios from "./axiosClient";
2
2
 
3
- module.exports = {
4
- axios: axios,
5
-
6
- /**
7
- * Add an entry to an array type business property such as experience, education or certifications
8
- * @param {String} userId
9
- * @param {String} property
10
- * @param {Object} data
11
- * @param {String} token Authorization token
12
- */
13
- addEntryToArrayBusinessProperty: (userId, property, data, token) => {
14
- return new Promise(function (resolve, reject) {
15
- const requestData = {
16
- data: data,
17
- };
18
- let confirmationRequest = axios.post(
19
- `api/v1/user/arrayproperty/${userId}/${property}`,
20
- requestData,
21
- {
22
- headers: { authorization: token },
23
- }
24
- );
25
- confirmationRequest
26
- .then((response) => {
27
- resolve(response.data);
28
- })
29
- .catch((error) => {
30
- reject(error);
31
- });
32
- });
33
- },
3
+ /**
4
+ * Add an entry to an array type business property such as experience, education or certifications
5
+ * @param {String} userId
6
+ * @param {String} property
7
+ * @param {Object} data
8
+ * @param {String} token Authorization token
9
+ */
10
+ export const addEntryToArrayBusinessProperty = (
11
+ userId,
12
+ property,
13
+ data,
14
+ token
15
+ ) => {
16
+ return new Promise(function (resolve, reject) {
17
+ const requestData = {
18
+ data: data,
19
+ };
20
+ let confirmationRequest = axios.post(
21
+ `api/v1/user/arrayproperty/${userId}/${property}`,
22
+ requestData,
23
+ {
24
+ headers: { authorization: token },
25
+ }
26
+ );
27
+ confirmationRequest
28
+ .then((response) => {
29
+ resolve(response.data);
30
+ })
31
+ .catch((error) => {
32
+ reject(error);
33
+ });
34
+ });
35
+ };
34
36
 
35
- /**
36
- * Update an entry from an array type business property such as experience, education or certifications
37
- * @param {String} userId
38
- * @param {String} property
39
- * @param {String} id
40
- * @param {String} token Authorization token
41
- */
42
- removeEntryFromArrayBusinessProperty: (userId, property, id, token) => {
43
- return new Promise(function (resolve, reject) {
44
- const confirmationRequest = axios.delete(
45
- `api/v1/user/arrayproperty/${userId}/${property}/${id}`,
46
- {
47
- headers: { authorization: token },
48
- }
49
- );
50
- confirmationRequest
51
- .then((response) => {
52
- resolve(response.data);
53
- })
54
- .catch((error) => {
55
- reject(error);
56
- });
57
- });
58
- },
37
+ /**
38
+ * Update an entry from an array type business property such as experience, education or certifications
39
+ * @param {String} userId
40
+ * @param {String} property
41
+ * @param {String} id
42
+ * @param {String} token Authorization token
43
+ */
44
+ export const removeEntryFromArrayBusinessProperty = (
45
+ userId,
46
+ property,
47
+ id,
48
+ token
49
+ ) => {
50
+ return new Promise(function (resolve, reject) {
51
+ const confirmationRequest = axios.delete(
52
+ `api/v1/user/arrayproperty/${userId}/${property}/${id}`,
53
+ {
54
+ headers: { authorization: token },
55
+ }
56
+ );
57
+ confirmationRequest
58
+ .then((response) => {
59
+ resolve(response.data);
60
+ })
61
+ .catch((error) => {
62
+ reject(error);
63
+ });
64
+ });
65
+ };
59
66
 
60
- /**
61
- * Update an entry from an array type business property such as experience, education or certifications
62
- * @param {String} userId
63
- * @param {String} property
64
- * @param {String} id
65
- * @param {Object} data
66
- * @param {String} token Authorization token
67
- */
68
- updateEntryfromArrayBusinessProperty: (userId, property, id, data, token) => {
69
- return new Promise(function (resolve, reject) {
70
- const requestData = {
71
- data: data,
72
- };
73
- let confirmationRequest = axios.patch(
74
- `api/v1/user/arrayproperty/${userId}/${property}/${id}`,
75
- requestData,
76
- {
77
- headers: { authorization: token },
78
- }
79
- );
80
- confirmationRequest
81
- .then((response) => {
82
- resolve(response.data);
83
- })
84
- .catch((error) => {
85
- reject(error);
86
- });
87
- });
88
- },
67
+ /**
68
+ * Update an entry from an array type business property such as experience, education or certifications
69
+ * @param {String} userId
70
+ * @param {String} property
71
+ * @param {String} id
72
+ * @param {Object} data
73
+ * @param {String} token Authorization token
74
+ */
75
+ export const updateEntryfromArrayBusinessProperty = (
76
+ userId,
77
+ property,
78
+ id,
79
+ data,
80
+ token
81
+ ) => {
82
+ return new Promise(function (resolve, reject) {
83
+ const requestData = {
84
+ data: data,
85
+ };
86
+ let confirmationRequest = axios.patch(
87
+ `api/v1/user/arrayproperty/${userId}/${property}/${id}`,
88
+ requestData,
89
+ {
90
+ headers: { authorization: token },
91
+ }
92
+ );
93
+ confirmationRequest
94
+ .then((response) => {
95
+ resolve(response.data);
96
+ })
97
+ .catch((error) => {
98
+ reject(error);
99
+ });
100
+ });
89
101
  };