@klauswuestefeld/jux-web 2024.12.9 → 2024.12.17

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/jux-web.js CHANGED
@@ -311,7 +311,7 @@ var juxWeb = (function (exports) {
311
311
  requestRunning = false;
312
312
  }
313
313
  });
314
- const post = (endpoint, body, onSuccess, onError, onRedirect, requestType = "query", handleUnauthorized) => {
314
+ const post = (endpoint, params, onSuccess, onError, onRedirect, requestType = "query", handleUnauthorized) => {
315
315
  const options = {
316
316
  method: 'POST',
317
317
  headers: {
@@ -319,9 +319,13 @@ var juxWeb = (function (exports) {
319
319
  'Content-Type': 'application/json',
320
320
  }
321
321
  };
322
- if (body) {
322
+ if (params) {
323
+ let content = params;
324
+ if (!(params instanceof File)) {
325
+ content = JSON.stringify(params);
326
+ }
323
327
  // @ts-ignore
324
- options.body = JSON.stringify(body);
328
+ options.body = content;
325
329
  }
326
330
  return backendRequest(getApiUrl() + endpoint, options, onSuccess, onError, onRedirect, requestType, handleUnauthorized);
327
331
  };
package/dist/main.esm.js CHANGED
@@ -310,7 +310,7 @@ const backendRequest = (url_1, options_1, onSuccess_1, onError_1, onRedirect_1,
310
310
  requestRunning = false;
311
311
  }
312
312
  });
313
- const post = (endpoint, body, onSuccess, onError, onRedirect, requestType = "query", handleUnauthorized) => {
313
+ const post = (endpoint, params, onSuccess, onError, onRedirect, requestType = "query", handleUnauthorized) => {
314
314
  const options = {
315
315
  method: 'POST',
316
316
  headers: {
@@ -318,9 +318,13 @@ const post = (endpoint, body, onSuccess, onError, onRedirect, requestType = "que
318
318
  'Content-Type': 'application/json',
319
319
  }
320
320
  };
321
- if (body) {
321
+ if (params) {
322
+ let content = params;
323
+ if (!(params instanceof File)) {
324
+ content = JSON.stringify(params);
325
+ }
322
326
  // @ts-ignore
323
- options.body = JSON.stringify(body);
327
+ options.body = content;
324
328
  }
325
329
  return backendRequest(getApiUrl() + endpoint, options, onSuccess, onError, onRedirect, requestType, handleUnauthorized);
326
330
  };
package/dist/main.js CHANGED
@@ -334,7 +334,7 @@ const backendRequest = (url_1, options_1, onSuccess_1, onError_1, onRedirect_1,
334
334
  requestRunning = false;
335
335
  }
336
336
  });
337
- const post = (endpoint, body, onSuccess, onError, onRedirect, requestType = "query", handleUnauthorized) => {
337
+ const post = (endpoint, params, onSuccess, onError, onRedirect, requestType = "query", handleUnauthorized) => {
338
338
  const options = {
339
339
  method: 'POST',
340
340
  headers: {
@@ -342,9 +342,13 @@ const post = (endpoint, body, onSuccess, onError, onRedirect, requestType = "que
342
342
  'Content-Type': 'application/json',
343
343
  }
344
344
  };
345
- if (body) {
345
+ if (params) {
346
+ let content = params;
347
+ if (!(params instanceof File)) {
348
+ content = JSON.stringify(params);
349
+ }
346
350
  // @ts-ignore
347
- options.body = JSON.stringify(body);
351
+ options.body = content;
348
352
  }
349
353
  return backendRequest(getApiUrl() + endpoint, options, onSuccess, onError, onRedirect, requestType, handleUnauthorized);
350
354
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klauswuestefeld/jux-web",
3
- "version": "2024.12.9",
3
+ "version": "2024.12.17",
4
4
  "author": "Jux.House",
5
5
  "license": "Copyrighted",
6
6
  "description": "",