style: lint en format
This commit is contained in:
parent
128c245779
commit
f971264ce6
4 changed files with 9 additions and 10 deletions
|
@ -15,7 +15,7 @@ export function makeTestClasses(em: EntityManager, students: Student[], teachers
|
||||||
});
|
});
|
||||||
|
|
||||||
const studentsClass02: Student[] = students.slice(0, 2).concat(students.slice(3, 4));
|
const studentsClass02: Student[] = students.slice(0, 2).concat(students.slice(3, 4));
|
||||||
const teacherClass02: Teacher[] = teachers.slice(1, 2).concat(teachers.slice(4,5));
|
const teacherClass02: Teacher[] = teachers.slice(1, 2);
|
||||||
|
|
||||||
const class02 = em.create(Class, {
|
const class02 = em.create(Class, {
|
||||||
classId: '34d484a1-295f-4e9f-bfdc-3e7a23d86a89',
|
classId: '34d484a1-295f-4e9f-bfdc-3e7a23d86a89',
|
||||||
|
|
|
@ -54,10 +54,9 @@ export class TeacherController extends BaseController {
|
||||||
studentUsername: string,
|
studentUsername: string,
|
||||||
accepted: boolean,
|
accepted: boolean,
|
||||||
): Promise<JoinRequestResponse> {
|
): Promise<JoinRequestResponse> {
|
||||||
return this.put<JoinRequestResponse>(
|
return this.put<JoinRequestResponse>(`/${teacherUsername}/joinRequests/${classId}/${studentUsername}`, {
|
||||||
`/${teacherUsername}/joinRequests/${classId}/${studentUsername}`,
|
accepted,
|
||||||
{accepted},
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetInvitations(id: string) {return this.get<{ invitations: string[] }>(`/${id}/invitations`);}
|
// GetInvitations(id: string) {return this.get<{ invitations: string[] }>(`/${id}/invitations`);}
|
||||||
|
|
|
@ -5,9 +5,8 @@
|
||||||
import type { ClassDTO } from "@dwengo-1/common/interfaces/class";
|
import type { ClassDTO } from "@dwengo-1/common/interfaces/class";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { ClassController, type ClassResponse } from "@/controllers/classes";
|
import { ClassController, type ClassResponse } from "@/controllers/classes";
|
||||||
import type { JoinRequestResponse, JoinRequestsResponse, StudentsResponse } from "@/controllers/students";
|
import type { JoinRequestsResponse, StudentsResponse } from "@/controllers/students";
|
||||||
import type { StudentDTO } from "@dwengo-1/common/interfaces/student";
|
import type { StudentDTO } from "@dwengo-1/common/interfaces/student";
|
||||||
import { useStudentJoinRequestQuery } from "@/queries/students";
|
|
||||||
import UsingQueryResult from "@/components/UsingQueryResult.vue";
|
import UsingQueryResult from "@/components/UsingQueryResult.vue";
|
||||||
import { useTeacherJoinRequestsQuery, useUpdateJoinRequestMutation } from "@/queries/teachers";
|
import { useTeacherJoinRequestsQuery, useUpdateJoinRequestMutation } from "@/queries/teachers";
|
||||||
import type { ClassJoinRequestDTO } from "@dwengo-1/common/interfaces/class-join-request";
|
import type { ClassJoinRequestDTO } from "@dwengo-1/common/interfaces/class-join-request";
|
||||||
|
@ -67,7 +66,8 @@
|
||||||
//TODO when query; reload table so student not longer in table
|
//TODO when query; reload table so student not longer in table
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleJoinRequest(c: ClassJoinRequestDTO, accepted: boolean) {
|
// TODO: query + relaoding
|
||||||
|
function handleJoinRequest(c: ClassJoinRequestDTO, accepted: boolean) : void {
|
||||||
mutate(
|
mutate(
|
||||||
{
|
{
|
||||||
teacherUsername: username.value!,
|
teacherUsername: username.value!,
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
showSnackbar(t("sent"), "success");
|
showSnackbar(t("sent"), "success");
|
||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
// showSnackbar(t("failed") + ": " + e.message, "error");
|
// ShowSnackbar(t("failed") + ": " + e.message, "error");
|
||||||
throw e;
|
throw e;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue