argous 1.2.211 → 1.2.213
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/index.js +8 -10
- package/lib/api/index.js +7 -9
- package/package.json +1 -1
package/dist/api/index.js
CHANGED
|
@@ -56,12 +56,10 @@ var api = function () { return "" + (config_1.getConfig().ssl ? 'https' : 'http'
|
|
|
56
56
|
exports.api = api;
|
|
57
57
|
// export const headers = (data) => ({ lgTkn: (data?.token) ? data.token : getCookie('lt') });
|
|
58
58
|
var headers = function (data) {
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
return headers;
|
|
59
|
+
var response = { lgTkn: (data === null || data === void 0 ? void 0 : data.token) ? data.token : utils_1.getCookie('lt') };
|
|
60
|
+
console.log('headers data', data);
|
|
61
|
+
console.log('headers', response);
|
|
62
|
+
return response;
|
|
65
63
|
};
|
|
66
64
|
exports.headers = headers;
|
|
67
65
|
/**
|
|
@@ -295,17 +293,17 @@ exports.agSet = agSet;
|
|
|
295
293
|
// return await res.json();
|
|
296
294
|
// };
|
|
297
295
|
var action = function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
298
|
-
var
|
|
296
|
+
var headersResponse, res;
|
|
299
297
|
return __generator(this, function (_a) {
|
|
300
298
|
switch (_a.label) {
|
|
301
299
|
case 0:
|
|
302
|
-
|
|
300
|
+
headersResponse = exports.headers(data);
|
|
303
301
|
console.log('action data', data);
|
|
304
|
-
console.log('action headers',
|
|
302
|
+
console.log('action headers', headersResponse);
|
|
305
303
|
return [4 /*yield*/, fetch(exports.api() + "agaction.rslvr", {
|
|
306
304
|
method: 'POST',
|
|
307
305
|
body: JSON.stringify(data),
|
|
308
|
-
headers:
|
|
306
|
+
headers: headersResponse
|
|
309
307
|
})];
|
|
310
308
|
case 1:
|
|
311
309
|
res = _a.sent();
|
package/lib/api/index.js
CHANGED
|
@@ -7,14 +7,12 @@ export const api = () => `${getConfig().ssl ? 'https' : 'http'}${server()}argous
|
|
|
7
7
|
|
|
8
8
|
// export const headers = (data) => ({ lgTkn: (data?.token) ? data.token : getCookie('lt') });
|
|
9
9
|
export const headers = (data) => {
|
|
10
|
-
const
|
|
10
|
+
const response = { lgTkn: (data?.token) ? data.token : getCookie('lt') };
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
console.log('headers', headers);
|
|
15
|
-
}
|
|
12
|
+
console.log('headers data', data);
|
|
13
|
+
console.log('headers', response);
|
|
16
14
|
|
|
17
|
-
return
|
|
15
|
+
return response;
|
|
18
16
|
};
|
|
19
17
|
|
|
20
18
|
/**
|
|
@@ -152,15 +150,15 @@ export const agSet = async (data) => {
|
|
|
152
150
|
// return await res.json();
|
|
153
151
|
// };
|
|
154
152
|
export const action = async (data) => {
|
|
155
|
-
const
|
|
153
|
+
const headersResponse = headers(data);
|
|
156
154
|
|
|
157
155
|
console.log('action data', data);
|
|
158
|
-
console.log('action headers',
|
|
156
|
+
console.log('action headers', headersResponse);
|
|
159
157
|
|
|
160
158
|
const res = await fetch(`${api()}agaction.rslvr`, {
|
|
161
159
|
method: 'POST',
|
|
162
160
|
body: JSON.stringify(data),
|
|
163
|
-
headers
|
|
161
|
+
headers: headersResponse
|
|
164
162
|
});
|
|
165
163
|
return await res.json();
|
|
166
164
|
};
|