From e3657986ce56cdbaf3677484f4a40235a04bbdce Mon Sep 17 00:00:00 2001 From: br0kenpixel <23280129+br0kenpixel@users.noreply.github.com> Date: Sat, 8 Nov 2025 14:16:14 +0100 Subject: [PATCH] fix: add error handling for fetch response in internship edit page --- .../student/internship/edit/[id].vue | 53 ++++++++++--------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/frontend/app/pages/dashboard/student/internship/edit/[id].vue b/frontend/app/pages/dashboard/student/internship/edit/[id].vue index 5d508c2..a7b8593 100644 --- a/frontend/app/pages/dashboard/student/internship/edit/[id].vue +++ b/frontend/app/pages/dashboard/student/internship/edit/[id].vue @@ -20,7 +20,7 @@ const client = useSanctumClient(); const loading = ref(false); const action_error = ref(null as null | string); -const { data, refresh } = await useSanctumFetch(`/api/internships/${route.params.id}`); +const { data, error, refresh } = await useSanctumFetch(`/api/internships/${route.params.id}`); async function handleUpdateOfBasicInfo(internship: NewInternship) { action_error.value = null; @@ -57,37 +57,42 @@ async function handleUpdateOfBasicInfo(internship: NewInternship) { -
-

Základné informácie

- - -
+ + -
+
+
+

Základné informácie

+ + +
-
-

Stav

-

Aktuálny stav

-

{{ prettyInternshipStatus(data?.status.status!) }}

-

Poznámka: {{ data?.status.note }}

-

Posledná zmena: {{ data?.status.changed }}, {{ data?.status.modified_by.name }}

+
-
+
+

Stav

+

Aktuálny stav

+

{{ prettyInternshipStatus(data?.status.status!) }}

+

Poznámka: {{ data?.status.note }}

+

Posledná zmena: {{ data?.status.changed }}, {{ data?.status.modified_by.name }}

-

História

- -
+
-
+

História

+ +
-
-

Nahratie dokumentov

+
- +
+

Nahratie dokumentov

- + + + +