fix: update student reference in internship tables to match data structure

This commit is contained in:
2025-11-06 15:56:47 +01:00
parent 4443a9b3a1
commit 8476ed49db
3 changed files with 36 additions and 30 deletions

View File

@@ -49,7 +49,7 @@ const { data, error } = await useSanctumFetch<Internship[]>('/api/internships');
<tbody>
<tr v-for="item in data">
<td>{{ item.company.name }}</td>
<td>{{ item.user!.name }}</td>
<td>{{ item.student.name }}</td>
<td>{{ item.start }}</td>
<td>{{ item.end }}</td>
<td>{{ item.year_of_study }}</td>

View File

@@ -21,7 +21,7 @@ const loading = ref(false);
const action_error = ref(null as null | string);
const refreshKey = ref(0);
const { data, refresh } = await useSanctumFetch<Internship>(`/api/internships/${route.params.id}`);
const { data, error: load_error, refresh } = await useSanctumFetch<Internship>(`/api/internships/${route.params.id}`);
async function handleUpdateOfBasicInfo(internship: NewInternship) {
action_error.value = null;
@@ -53,11 +53,15 @@ async function handleUpdateOfBasicInfo(internship: NewInternship) {
<div style="height: 40px;"></div>
<!-- Čakajúca hláška -->
<LoadingAlert />
<LoadingAlert v-if="loading" />
<!-- Chybová hláška -->
<ErrorAlert v-if="action_error" :error="action_error" />
<!-- Chybová hláška -->
<ErrorAlert v-if="load_error" :error="load_error.message" />
<div v-else>
<div>
<h2>Základné informácie</h2>
<ErrorAlert v-if="data?.status.status !== InternshipStatus.SUBMITTED" title="Blokované"
@@ -82,7 +86,8 @@ async function handleUpdateOfBasicInfo(internship: NewInternship) {
<br />
<h4>Zmena stavu</h4>
<InternshipStatusEditor :internship="data!" @successful-submit="() => { refresh(); refreshKey++; }" />
<InternshipStatusEditor :internship="data!"
@successful-submit="() => { refresh(); refreshKey++; }" />
</div>
<hr />
@@ -95,6 +100,7 @@ async function handleUpdateOfBasicInfo(internship: NewInternship) {
<InternshipDocumentEditor v-else :internship="data!" @successful-submit="refresh" />
</div>
</div>
</v-card>
</v-container>
</template>

View File

@@ -47,7 +47,7 @@ const { data, error } = await useSanctumFetch<Internship[]>('/api/internships/my
</thead>
<tbody>
<tr v-for="item in data">
<td>{{ item.user!.name }}</td>
<td>{{ item.student.name }}</td>
<td>{{ item.start }}</td>
<td>{{ item.end }}</td>
<td>{{ item.year_of_study }}</td>