From 323ea3902bbdaade82584e3ee559f9b52fc05252 Mon Sep 17 00:00:00 2001 From: br0kenpixel <23280129+br0kenpixel@users.noreply.github.com> Date: Sat, 1 Nov 2025 23:36:33 +0100 Subject: [PATCH] fix: incorrect API calls and failing to refresh `InternshipStatusHistoryView` and `InternshipStatusEditor` --- .../app/components/InternshipStatusEditor.vue | 7 +++---- .../components/InternshipStatusHistoryView.vue | 18 +++++++++--------- .../dashboard/admin/internships/edit/[id].vue | 6 +++--- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/frontend/app/components/InternshipStatusEditor.vue b/frontend/app/components/InternshipStatusEditor.vue index b4037f2..9860666 100644 --- a/frontend/app/components/InternshipStatusEditor.vue +++ b/frontend/app/components/InternshipStatusEditor.vue @@ -14,10 +14,10 @@ const user = useSanctumUser(); const rules = { required: (v: any) => (!!v && String(v).trim().length > 0) || 'Povinné pole', }; -const possible_states = possibleNextStates(props.internship.status.status, user.value!.role).map((state) => ({ +const possible_states = computed(() => possibleNextStates(props.internship.status.status, user.value!.role).map((state) => ({ title: prettyInternshipStatus(state), value: state -})); +}))); const isValid = ref(false); const new_state = ref(null as InternshipStatus | null); @@ -26,7 +26,6 @@ const note = ref(""); const loading = ref(false); const error = ref(null as null | string); -const route = useRoute(); const client = useSanctumClient(); async function submit() { @@ -39,7 +38,7 @@ async function submit() { }; try { - await client(`/api/internships/${route.params.id}/status`, { + await client(`/api/internships/${props.internship.id}/status`, { method: 'PUT', body: new_status }); diff --git a/frontend/app/components/InternshipStatusHistoryView.vue b/frontend/app/components/InternshipStatusHistoryView.vue index b090b7d..47f09e7 100644 --- a/frontend/app/components/InternshipStatusHistoryView.vue +++ b/frontend/app/components/InternshipStatusHistoryView.vue @@ -1,13 +1,10 @@