eservices-core 1.0.416 → 1.0.417

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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * eservices-core v1.0.416
2
+ * eservices-core v1.0.417
3
3
  * (c) 2022 ESERVICES
4
4
  */
5
5
  'use strict';
@@ -1917,6 +1917,7 @@ class CoreError extends Error {
1917
1917
  CoreError.ID = 0;
1918
1918
 
1919
1919
  /**
1920
+ * @deprecated
1920
1921
  * @description Функция для запросов, имеет встроенные обработчик для ошибок на самом низком уровне
1921
1922
  * */
1922
1923
  function Request(url, params = {}) {
@@ -6137,7 +6138,7 @@ function useFormAction(form, options) {
6137
6138
  return {
6138
6139
  title,
6139
6140
  callback: () => {
6140
- const fn = () => Request(url, {
6141
+ const fn = () => fetch(url, {
6141
6142
  method: "POST",
6142
6143
  body: JSON.stringify({
6143
6144
  keys: {
@@ -6147,16 +6148,22 @@ function useFormAction(form, options) {
6147
6148
  headers: {
6148
6149
  'Content-Type': 'application/json',
6149
6150
  },
6150
- })
6151
+ }).then(res => res.json())
6151
6152
  .then((result) => {
6152
- if (options === null || options === void 0 ? void 0 : options.ModalValidationResult) {
6153
- jenesiusVueModal.openModal(options.ModalValidationResult, {
6154
- rules: result.validationEffect.results
6155
- });
6153
+ if (!result.success) {
6154
+ if ((options === null || options === void 0 ? void 0 : options.ModalValidationResult) && result.validationEffect) {
6155
+ jenesiusVueModal.openModal(options.ModalValidationResult, {
6156
+ rules: result.validationEffect.results
6157
+ });
6158
+ }
6159
+ else {
6160
+ NotificationSystem.add("error", result.message);
6161
+ }
6162
+ throw new Error();
6156
6163
  }
6157
6164
  })
6158
6165
  .then(() => form.read());
6159
- return requestHandler(fn, { throw: false });
6166
+ return fn();
6160
6167
  }
6161
6168
  };
6162
6169
  }));
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @deprecated
2
3
  * @description Функция для запросов, имеет встроенные обработчик для ошибок на самом низком уровне
3
4
  * */
4
5
  export default function Request(url: string, params?: RequestInit): Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eservices-core",
3
- "version": "1.0.416",
3
+ "version": "1.0.417",
4
4
  "description": "Core library",
5
5
  "author": "",
6
6
  "scripts": {