@unsource/ui 2.8.17 → 2.8.18

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/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unsource-ui",
3
3
  "configKey": "unsourceUi",
4
- "version": "2.8.17",
4
+ "version": "2.8.18",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,5 +1,5 @@
1
1
  import { useModuleConfig, useToken } from "./reuseable.js";
2
- import { _get, _set, useNuxtApp, isArray } from "#imports";
2
+ import { _get, _set, useNuxtApp, isArray, isPlainObject } from "#imports";
3
3
  const setHeaders = (config) => {
4
4
  const token = useToken();
5
5
  _set(config, ["headers", "Authorization"], _get(config, ["headers", "Authorization"], token.value || ""));
@@ -8,11 +8,11 @@ const setHeaders = (config) => {
8
8
  };
9
9
  const errorHandler = (error, config) => {
10
10
  if ("data" in error) {
11
- let msg = "";
12
- if ("errors" in error.data && isArray(error.data.errors)) {
13
- msg = error?.data?.errors?.map?.((e) => e.field + ":" + e.message).join(" , ");
14
- }
15
11
  if (!config?.headers?.["no-error"]) {
12
+ let msg = "";
13
+ if (isPlainObject(error.data) && "errors" in error.data && isArray(error.data.errors)) {
14
+ msg = error?.data?.errors?.map?.((e) => e.field + ":" + e.message).join(" , ");
15
+ }
16
16
  const { $toast } = useNuxtApp();
17
17
  $toast?.error(msg || JSON.stringify(error?.data));
18
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unsource/ui",
3
- "version": "2.8.17",
3
+ "version": "2.8.18",
4
4
  "private": false,
5
5
  "description": "nuxt ui kit for unsource env",
6
6
  "repository": "https://github.com/alisa2142/unsource-ui",