fix: v-else op verkeerde plaats
This commit is contained in:
		
							parent
							
								
									e297f25888
								
							
						
					
					
						commit
						c3d93f766d
					
				
					 1 changed files with 29 additions and 19 deletions
				
			
		|  | @ -10,7 +10,11 @@ | |||
|     import UsingQueryResult from "@/components/UsingQueryResult.vue"; | ||||
|     import { useClassesQuery, useClassTeacherInvitationsQuery, useCreateClassMutation } from "@/queries/classes"; | ||||
|     import type { TeacherInvitationsResponse } from "@/controllers/teacher-invitations"; | ||||
| import { useRespondTeacherInvitationMutation, useTeacherInvitationsReceivedQuery, useTeacherInvitationsSentQuery } from "@/queries/teacher-invitations"; | ||||
|     import { | ||||
|         useRespondTeacherInvitationMutation, | ||||
|         useTeacherInvitationsReceivedQuery, | ||||
|         useTeacherInvitationsSentQuery, | ||||
|     } from "@/queries/teacher-invitations"; | ||||
| 
 | ||||
|     const { t } = useI18n(); | ||||
| 
 | ||||
|  | @ -50,10 +54,15 @@ import { useRespondTeacherInvitationMutation, useTeacherInvitationsReceivedQuery | |||
| 
 | ||||
|     // Function to handle an invitation request | ||||
|     function handleInvitation(ti: TeacherInvitationDTO, accepted: boolean): void { | ||||
|         const data: TeacherInvitationData = {sender: (ti.sender as TeacherDTO).id, receiver: (ti.receiver as TeacherDTO).id, class: ti.classId, accepted: accepted}; | ||||
|         const data: TeacherInvitationData = { | ||||
|             sender: (ti.sender as TeacherDTO).id, | ||||
|             receiver: (ti.receiver as TeacherDTO).id, | ||||
|             class: ti.classId, | ||||
|             accepted: accepted, | ||||
|         }; | ||||
|         respondToInvitation(data, { | ||||
|             onSuccess: async () => { | ||||
|                 if (accepted){ | ||||
|                 if (accepted) { | ||||
|                     await classesQuery.refetch(); | ||||
|                 } | ||||
| 
 | ||||
|  | @ -61,7 +70,7 @@ import { useRespondTeacherInvitationMutation, useTeacherInvitationsReceivedQuery | |||
|             }, | ||||
|             onError: (e) => { | ||||
|                 showSnackbar(t("failed") + ": " + e.message, "error"); | ||||
|             } | ||||
|             }, | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|  | @ -142,8 +151,8 @@ import { useRespondTeacherInvitationMutation, useTeacherInvitationsReceivedQuery | |||
|                 :text="errorMessage" | ||||
|                 :title="t('error_title')" | ||||
|             ></v-empty-state> | ||||
|     </div v-else> | ||||
|         <div> | ||||
|         </div> | ||||
|         <div v-else> | ||||
|             <h1 class="title">{{ t("classes") }}</h1> | ||||
|             <using-query-result | ||||
|                 :query-result="classesQuery" | ||||
|  | @ -294,7 +303,8 @@ import { useRespondTeacherInvitationMutation, useTeacherInvitationsReceivedQuery | |||
|                             > | ||||
|                                 <td> | ||||
|                                     {{ | ||||
|                                         (classesResponse.data.classes as ClassDTO[]).filter((c) => c.id == i.classId)[0].displayName | ||||
|                                         (classesResponse.data.classes as ClassDTO[]).filter((c) => c.id == i.classId)[0] | ||||
|                                             .displayName | ||||
|                                     }} | ||||
|                                 </td> | ||||
|                                 <td> | ||||
|  |  | |||
		Reference in a new issue
	
	 laurejablonski
						laurejablonski