@omnitend/dashboard-for-laravel 0.49.0 → 0.49.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.
@@ -1,8 +1,8 @@
1
1
  {
2
- "generated": "2026-11-23T10:27:27.096Z",
2
+ "generated": "2026-11-23T10:50:36.308Z",
3
3
  "package": {
4
4
  "name": "@omnitend/dashboard-for-laravel",
5
- "version": "0.49.0"
5
+ "version": "0.49.1"
6
6
  },
7
7
  "components": {
8
8
  "base": [
@@ -1,7 +1,7 @@
1
1
  # Documentation Map
2
2
 
3
3
  > Auto-generated hierarchical overview of all documentation
4
- > Last updated: 2026-11-23T10:27:27.161Z
4
+ > Last updated: 2026-11-23T10:50:36.385Z
5
5
 
6
6
  This file provides a complete map of all available documentation for AI agents and developers.
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnitend/dashboard-for-laravel",
3
- "version": "0.49.0",
3
+ "version": "0.49.1",
4
4
  "description": "Vue 3 dashboard components for Laravel with Bootstrap Vue Next",
5
5
  "type": "module",
6
6
  "main": "./dist/dashboard-for-laravel.umd.cjs",
@@ -230,8 +230,8 @@ export function isAbortError(error: unknown): boolean {
230
230
  * The `submitFailure` for a rejected submit, or `null` for an abort (the
231
231
  * caller cancelled it; nothing failed). Only an `ApiError` from the client
232
232
  * (an HTTP failure: it carries a numeric `status`, and the client has already
233
- * replaced 401/403/404/419/500 bodies with user-facing text) supplies the
234
- * message. Anything else (a network `TypeError`, an exception thrown from
233
+ * replaced 401/404/419/500 bodies, and a 403 that carries no message, with
234
+ * user-facing text) supplies the message. Anything else (a network `TypeError`, an exception thrown from
235
235
  * `onSuccess`) gets the generic message, so a summary never shows
236
236
  * "Failed to fetch" or a stack-trace line.
237
237
  */
@@ -14,6 +14,11 @@ interface RequestOptions extends Omit<RequestInit, "body"> {
14
14
  body?: BodyInit | null; // allow FormData/Blob/etc.
15
15
  }
16
16
 
17
+ /** `value` when it is a string with something other than whitespace, else `null`. */
18
+ function nonBlankString(value: unknown): string | null {
19
+ return typeof value === "string" && value.trim() !== "" ? value : null;
20
+ }
21
+
17
22
  class ApiClient {
18
23
  private baseURL = "";
19
24
  private defaultHeaders: Record<string, string> = {
@@ -70,7 +75,13 @@ class ApiClient {
70
75
  error.message = "Unauthenticated. Please log in.";
71
76
  break;
72
77
  case 403:
73
- error.message = "Forbidden. You do not have permission.";
78
+ // A 403 is how a Laravel app says WHY an action is refused
79
+ // (`abort(403, 'reason')`, a policy's `Response::deny()`), so
80
+ // keep the server's message; Laravel's bare default ("This
81
+ // action is unauthorized.") is still better than ours.
82
+ error.message =
83
+ nonBlankString(data?.message) ??
84
+ "Forbidden. You do not have permission.";
74
85
  break;
75
86
  case 404:
76
87
  error.message = "Resource not found.";