@credithub/harlan-components 1.100.1 → 1.100.2
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/components/liminar/useLiminarHistory.js +13 -20
- package/lib/cjs/index.js +242 -249
- package/lib/esm/index.js +242 -249
- package/package.json +1 -1
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
13
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
14
|
if (ar || !(i in from)) {
|
|
@@ -11,6 +22,7 @@ import { useEffect, useRef } from 'react';
|
|
|
11
22
|
import { useFetch } from '../webservice';
|
|
12
23
|
export function useLiminarHistory(_a) {
|
|
13
24
|
var documento = _a.documento, indicioDeLiminar = _a.indicioDeLiminar, types = _a.types, _b = _a.protestKeys, protestKeys = _b === void 0 ? [] : _b, _c = _a.processIds, processIds = _c === void 0 ? [] : _c, _d = _a.enabled, enabled = _d === void 0 ? true : _d;
|
|
25
|
+
// Usamos any aqui para permitir booleanos e arrays nativos no payload
|
|
14
26
|
var insertHistory = useFetch("INSERT INTO 'LIMINAR'.'INTERFACE'").fetch;
|
|
15
27
|
var lastFingerprint = useRef();
|
|
16
28
|
useEffect(function () {
|
|
@@ -28,26 +40,7 @@ export function useLiminarHistory(_a) {
|
|
|
28
40
|
});
|
|
29
41
|
if (fingerprint === lastFingerprint.current)
|
|
30
42
|
return;
|
|
31
|
-
var payload = {
|
|
32
|
-
documento: documento,
|
|
33
|
-
indicioDeLiminar: safeIndicio ? 'true' : 'false'
|
|
34
|
-
};
|
|
35
|
-
// Serializa arrays como campos indexados (types[0], types[1], ...)
|
|
36
|
-
if (safeIndicio && effectiveTypes.length) {
|
|
37
|
-
effectiveTypes.forEach(function (t, i) {
|
|
38
|
-
payload["types[".concat(i, "]")] = t;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
if (protestKeys.length) {
|
|
42
|
-
protestKeys.forEach(function (k, i) {
|
|
43
|
-
payload["protestKeys[".concat(i, "]")] = k;
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
if (processIds.length) {
|
|
47
|
-
processIds.forEach(function (p, i) {
|
|
48
|
-
payload["processIds[".concat(i, "]")] = p;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
43
|
+
var payload = __assign(__assign({ documento: documento, indicioDeLiminar: safeIndicio, types: effectiveTypes }, (protestKeys.length ? { protestKeys: protestKeys } : {})), (processIds.length ? { processIds: processIds } : {}));
|
|
51
44
|
insertHistory(payload);
|
|
52
45
|
lastFingerprint.current = fingerprint;
|
|
53
46
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|