@pokash/n8n-nodes-optima-rest-api 1.12.0 → 1.12.1
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.
|
@@ -999,11 +999,16 @@ class OptimaRestApi {
|
|
|
999
999
|
const url = queryString
|
|
1000
1000
|
? `${gatewayUrl}/api/customer?${queryString}`
|
|
1001
1001
|
: `${gatewayUrl}/api/customer`;
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1002
|
+
// TNXP-791: skonfigurowany filtr dokładny z pustą wartością (np. pusty akronim z wyrażenia) = brak wyników,
|
|
1003
|
+
// jak dawny surowy filtr Knt_Kod='' — bez tego węzeł pominąłby filtr i zwrócił całą listę.
|
|
1004
|
+
const pustyFiltrDokladny = ['kod', 'nip', 'email', 'grupa'].some((pole) => { var _a; return pole in options && String((_a = options[pole]) !== null && _a !== void 0 ? _a : '').trim() === ''; });
|
|
1005
|
+
const response = pustyFiltrDokladny
|
|
1006
|
+
? { Success: true, Customers: [], TotalCount: 0 }
|
|
1007
|
+
: await makeAuthenticatedRequest({
|
|
1008
|
+
method: 'GET',
|
|
1009
|
+
url,
|
|
1010
|
+
json: true,
|
|
1011
|
+
});
|
|
1007
1012
|
// API returns { Success: true, Customers: [...], TotalCount: ... }
|
|
1008
1013
|
const responseData = response;
|
|
1009
1014
|
// Extract customers array from response
|
|
@@ -1324,11 +1329,16 @@ class OptimaRestApi {
|
|
|
1324
1329
|
const url = queryString
|
|
1325
1330
|
? `${gatewayUrl}/api/product?${queryString}`
|
|
1326
1331
|
: `${gatewayUrl}/api/product`;
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
+
// TNXP-791: skonfigurowany filtr dokładny z pustą wartością (np. pusty akronim z wyrażenia) = brak wyników,
|
|
1333
|
+
// jak dawny surowy filtr Knt_Kod='' — bez tego węzeł pominąłby filtr i zwrócił całą listę.
|
|
1334
|
+
const pustyFiltrDokladny = ['kod', 'ean', 'grupa'].some((pole) => { var _a; return pole in options && String((_a = options[pole]) !== null && _a !== void 0 ? _a : '').trim() === ''; });
|
|
1335
|
+
const response = pustyFiltrDokladny
|
|
1336
|
+
? { Success: true, Products: [], TotalCount: 0 }
|
|
1337
|
+
: await makeAuthenticatedRequest({
|
|
1338
|
+
method: 'GET',
|
|
1339
|
+
url,
|
|
1340
|
+
json: true,
|
|
1341
|
+
});
|
|
1332
1342
|
// API returns { Success: true, Products: [...], TotalCount: ... }
|
|
1333
1343
|
const responseData = response;
|
|
1334
1344
|
// Extract products array from response
|