fix: lint

This commit is contained in:
Gabriellvl 2025-04-13 20:54:05 +02:00
parent 17dc9649c5
commit a824cdff94
6 changed files with 5 additions and 11 deletions

View file

@ -1,5 +1,4 @@
import { TeacherInvitation } from '../entities/classes/teacher-invitation.entity.js';
import { mapToClassDTO } from './class.js';
import { mapToUserDTO } from './user.js';
import { TeacherInvitationDTO } from '@dwengo-1/common/interfaces/teacher-invitation';
import {getTeacherInvitationRepository} from "../data/repositories";

View file

@ -50,7 +50,7 @@ async function fetchInvitation(sender: Teacher, receiver: Teacher, cls: Class):
return invite;
}
export async function deleteInvitationFor(usernameSender: string, usernameReceiver: string, classId: string, accepted: boolean) {
export async function deleteInvitationFor(usernameSender: string, usernameReceiver: string, classId: string, accepted: boolean): Promise<TeacherInvitationDTO> {
const teacherInvitationRepository = getTeacherInvitationRepository();
const sender = await fetchTeacher(usernameSender);
const receiver = await fetchTeacher(usernameReceiver);

View file

@ -42,9 +42,6 @@ export async function setupTestApp(): Promise<void> {
const answers = makeTestAnswers(em, teachers, questions);
const submissions = makeTestSubmissions(em, students, groups);
console.log("classes", classes);
console.log("invitations", teacherInvitations);
await em.persistAndFlush([
...students,
...teachers,

View file

@ -1,5 +1,4 @@
import { UserDTO } from './user';
import { ClassDTO } from './class';
export interface TeacherInvitationDTO {
sender: string | UserDTO;

View file

@ -2,7 +2,6 @@ import { BaseController } from "./base-controller";
import type { ClassDTO } from "@dwengo-1/common/interfaces/class";
import type { StudentsResponse } from "./students";
import type { AssignmentsResponse } from "./assignments";
import type { TeacherInvitationDTO } from "@dwengo-1/common/interfaces/teacher-invitation";
import type { TeachersResponse } from "@/controllers/teachers.ts";
import type {TeacherInvitationsResponse} from "@/controllers/teacher-invitations.ts";

View file

@ -17,23 +17,23 @@ import type {TeacherDTO} from "@dwengo-1/common/dist/interfaces/teacher.ts";
const controller = new TeacherInvitationController();
/**
all the invitations the teacher send
All the invitations the teacher send
**/
export function useTeacherInvitationsByQuery(username: MaybeRefOrGetter<string | undefined>
): UseQueryReturnType<TeacherInvitationsResponse, Error> {
return useQuery({
queryFn: computed(() => controller.getAll(toValue(username), true)),
queryFn: computed(async () => controller.getAll(toValue(username), true)),
enabled: () => Boolean(toValue(username)),
})
}
/**
all the pending invitations send to this teacher
All the pending invitations send to this teacher
*/
export function useTeacherInvitationsForQuery(username: MaybeRefOrGetter<string | undefined>
): UseQueryReturnType<TeacherInvitationsResponse, Error> {
return useQuery({
queryFn: computed(() => controller.getAll(toValue(username), false)),
queryFn: computed(async () => controller.getAll(toValue(username), false)),
enabled: () => Boolean(toValue(username)),
})
}