You've already forked isop-mirror
fix: update student reference in internship tables to match data structure
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user