@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.
- package/dist/dashboard-for-laravel.js +189 -186
- package/dist/dashboard-for-laravel.js.map +1 -1
- package/dist/dashboard-for-laravel.umd.cjs +3 -3
- package/dist/dashboard-for-laravel.umd.cjs.map +1 -1
- package/docs/public/api-reference.json +2 -2
- package/docs/public/docs-map.md +1 -1
- package/package.json +1 -1
- package/resources/js/composables/useForm.ts +2 -2
- package/resources/js/utils/api.ts +12 -1
package/docs/public/docs-map.md
CHANGED
|
@@ -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:
|
|
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
|
@@ -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/
|
|
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
|
-
|
|
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.";
|