style: fix linting issues met Prettier
This commit is contained in:
		
							parent
							
								
									a5e4f2437b
								
							
						
					
					
						commit
						447fd150da
					
				
					 7 changed files with 20 additions and 21 deletions
				
			
		|  | @ -3,7 +3,7 @@ import { AuthenticationInfo } from '../authentication-info.js'; | ||||||
| import { AuthenticatedRequest } from '../authenticated-request.js'; | import { AuthenticatedRequest } from '../authenticated-request.js'; | ||||||
| import { fetchClass } from '../../../services/classes.js'; | import { fetchClass } from '../../../services/classes.js'; | ||||||
| import { mapToUsername } from '../../../interfaces/user.js'; | import { mapToUsername } from '../../../interfaces/user.js'; | ||||||
| import {getAllInvitations} from "../../../services/teacher-invitations"; | import { getAllInvitations } from '../../../services/teacher-invitations'; | ||||||
| 
 | 
 | ||||||
| async function teaches(teacherUsername: string, classId: string): Promise<boolean> { | async function teaches(teacherUsername: string, classId: string): Promise<boolean> { | ||||||
|     const clazz = await fetchClass(classId); |     const clazz = await fetchClass(classId); | ||||||
|  | @ -50,7 +50,7 @@ export const onlyAllowIfInClassOrInvited = authorize(async (auth: Authentication | ||||||
|     const clazz = await fetchClass(classId); |     const clazz = await fetchClass(classId); | ||||||
|     if (auth.accountType === 'teacher') { |     if (auth.accountType === 'teacher') { | ||||||
|         const invitations = await getAllInvitations(auth.username, false); |         const invitations = await getAllInvitations(auth.username, false); | ||||||
|         return clazz.teachers.map(mapToUsername).includes(auth.username) || invitations.some(invitation => invitation.classId === classId); |         return clazz.teachers.map(mapToUsername).includes(auth.username) || invitations.some((invitation) => invitation.classId === classId); | ||||||
|     } |     } | ||||||
|     return clazz.students.map(mapToUsername).includes(auth.username); |     return clazz.students.map(mapToUsername).includes(auth.username); | ||||||
| }); | }); | ||||||
|  |  | ||||||
|  | @ -5,7 +5,7 @@ import { authenticatedOnly, studentsOnly, teachersOnly } from '../middleware/aut | ||||||
| const router = express.Router(); | const router = express.Router(); | ||||||
| 
 | 
 | ||||||
| // Returns auth configuration for frontend
 | // Returns auth configuration for frontend
 | ||||||
| router.get('/config', handleGetFrontendAuthConfig) | router.get('/config', handleGetFrontendAuthConfig); | ||||||
| 
 | 
 | ||||||
| router.get('/testAuthenticatedOnly', authenticatedOnly, (_req, res) => { | router.get('/testAuthenticatedOnly', authenticatedOnly, (_req, res) => { | ||||||
|     /* #swagger.security = [{ "student": [ ] }, { "teacher": [ ] }] */ |     /* #swagger.security = [{ "student": [ ] }, { "teacher": [ ] }] */ | ||||||
|  |  | ||||||
|  | @ -15,7 +15,7 @@ import { | ||||||
| } from '../controllers/classes.js'; | } from '../controllers/classes.js'; | ||||||
| import assignmentRouter from './assignments.js'; | import assignmentRouter from './assignments.js'; | ||||||
| import { adminOnly, teachersOnly } from '../middleware/auth/checks/auth-checks.js'; | import { adminOnly, teachersOnly } from '../middleware/auth/checks/auth-checks.js'; | ||||||
| import {onlyAllowIfInClass, onlyAllowIfInClassOrInvited} from '../middleware/auth/checks/class-auth-checks.js'; | import { onlyAllowIfInClass, onlyAllowIfInClassOrInvited } from '../middleware/auth/checks/class-auth-checks.js'; | ||||||
| 
 | 
 | ||||||
| const router = express.Router(); | const router = express.Router(); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -15,7 +15,7 @@ import { invalidateAllGroupKeys } from "./groups"; | ||||||
| import { invalidateAllSubmissionKeys } from "./submissions"; | import { invalidateAllSubmissionKeys } from "./submissions"; | ||||||
| import type { TeachersResponse } from "@/controllers/teachers"; | import type { TeachersResponse } from "@/controllers/teachers"; | ||||||
| import type { TeacherInvitationsResponse } from "@/controllers/teacher-invitations"; | import type { TeacherInvitationsResponse } from "@/controllers/teacher-invitations"; | ||||||
| import {studentClassesQueryKey} from "@/queries/students.ts"; | import { studentClassesQueryKey } from "@/queries/students.ts"; | ||||||
| 
 | 
 | ||||||
| const classController = new ClassController(); | const classController = new ClassController(); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,19 +1,20 @@ | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { useClassQuery } from '@/queries/classes'; |     import { useClassQuery } from "@/queries/classes"; | ||||||
| import { defineProps } from 'vue'; |     import { defineProps } from "vue"; | ||||||
| import UsingQueryResult from "@/components/UsingQueryResult.vue"; |     import UsingQueryResult from "@/components/UsingQueryResult.vue"; | ||||||
| 
 | 
 | ||||||
| const props = defineProps({ |     const props = defineProps({ | ||||||
|         classId: String, |         classId: String, | ||||||
| }); |     }); | ||||||
| 
 | 
 | ||||||
| const classQuery = useClassQuery(props.classId); |     const classQuery = useClassQuery(props.classId); | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
| <template> | <template> | ||||||
|     <using-query-result :query-result="classQuery" v-slot="{ data: classResponse }"> |     <using-query-result | ||||||
|         <span>{{ classResponse?.class.displayName}}</span> |         :query-result="classQuery" | ||||||
|  |         v-slot="{ data: classResponse }" | ||||||
|  |     > | ||||||
|  |         <span>{{ classResponse?.class.displayName }}</span> | ||||||
|     </using-query-result> |     </using-query-result> | ||||||
| </template> | </template> | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|  |  | ||||||
|  | @ -125,8 +125,8 @@ | ||||||
|                 usernameTeacher.value = ""; |                 usernameTeacher.value = ""; | ||||||
|             }, |             }, | ||||||
|             onError: (e) => { |             onError: (e) => { | ||||||
|                 console.log("error", e) |                 console.log("error", e); | ||||||
|                 console.log(e.response.data.error) |                 console.log(e.response.data.error); | ||||||
|                 showSnackbar(t("failed") + ": " + e.response.data.error || e.message, "error"); |                 showSnackbar(t("failed") + ": " + e.response.data.error || e.message, "error"); | ||||||
|             }, |             }, | ||||||
|         }); |         }); | ||||||
|  |  | ||||||
|  | @ -346,9 +346,7 @@ | ||||||
|                                     <ClassDisplay :classId="i.classId" /> |                                     <ClassDisplay :classId="i.classId" /> | ||||||
|                                 </td> |                                 </td> | ||||||
|                                 <td> |                                 <td> | ||||||
|                                     {{ |                                     {{ (i.sender as TeacherDTO).firstName + " " + (i.sender as TeacherDTO).lastName }} | ||||||
|                                         (i.sender as TeacherDTO).firstName + " " + (i.sender as TeacherDTO).lastName |  | ||||||
|                                     }} |  | ||||||
|                                 </td> |                                 </td> | ||||||
|                                 <td class="text-right"> |                                 <td class="text-right"> | ||||||
|                                     <span v-if="!isSmAndDown"> |                                     <span v-if="!isSmAndDown"> | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Lint Action
						Lint Action