style: fix linting issues met Prettier
This commit is contained in:
parent
9895d22521
commit
ee5f69cbc8
20 changed files with 188 additions and 192 deletions
|
@ -6,24 +6,24 @@ import {
|
|||
getTeacherRepository,
|
||||
} from '../data/repositories.js';
|
||||
import { ClassDTO, mapToClassDTO } from '../interfaces/class.js';
|
||||
import {mapToQuestionDTO, mapToQuestionId, QuestionDTO, QuestionId} from '../interfaces/question.js';
|
||||
import { mapToQuestionDTO, mapToQuestionId, QuestionDTO, QuestionId } from '../interfaces/question.js';
|
||||
import { mapToTeacher, mapToTeacherDTO, TeacherDTO } from '../interfaces/teacher.js';
|
||||
import {Teacher} from "../entities/users/teacher.entity.js";
|
||||
import {fetchStudent} from "./students.js";
|
||||
import {ClassJoinRequest, ClassJoinRequestStatus} from "../entities/classes/class-join-request.entity.js";
|
||||
import {mapToStudentRequestDTO, StudentRequestDTO} from "../interfaces/student-request.js";
|
||||
import {TeacherRepository} from "../data/users/teacher-repository.js";
|
||||
import {ClassRepository} from "../data/classes/class-repository.js";
|
||||
import {Class} from "../entities/classes/class.entity.js";
|
||||
import {StudentDTO} from "../interfaces/student.js";
|
||||
import {LearningObjectRepository} from "../data/content/learning-object-repository.js";
|
||||
import {LearningObject} from "../entities/content/learning-object.entity.js";
|
||||
import {QuestionRepository} from "../data/questions/question-repository.js";
|
||||
import {Question} from "../entities/questions/question.entity.js";
|
||||
import {ClassJoinRequestRepository} from "../data/classes/class-join-request-repository.js";
|
||||
import {Student} from "../entities/users/student.entity.js";
|
||||
import {NotFoundException} from "../exceptions/not-found-exception.js";
|
||||
import {getClassStudents} from "./classes.js";
|
||||
import { Teacher } from '../entities/users/teacher.entity.js';
|
||||
import { fetchStudent } from './students.js';
|
||||
import { ClassJoinRequest, ClassJoinRequestStatus } from '../entities/classes/class-join-request.entity.js';
|
||||
import { mapToStudentRequestDTO, StudentRequestDTO } from '../interfaces/student-request.js';
|
||||
import { TeacherRepository } from '../data/users/teacher-repository.js';
|
||||
import { ClassRepository } from '../data/classes/class-repository.js';
|
||||
import { Class } from '../entities/classes/class.entity.js';
|
||||
import { StudentDTO } from '../interfaces/student.js';
|
||||
import { LearningObjectRepository } from '../data/content/learning-object-repository.js';
|
||||
import { LearningObject } from '../entities/content/learning-object.entity.js';
|
||||
import { QuestionRepository } from '../data/questions/question-repository.js';
|
||||
import { Question } from '../entities/questions/question.entity.js';
|
||||
import { ClassJoinRequestRepository } from '../data/classes/class-join-request-repository.js';
|
||||
import { Student } from '../entities/users/student.entity.js';
|
||||
import { NotFoundException } from '../exceptions/not-found-exception.js';
|
||||
import { getClassStudents } from './classes.js';
|
||||
|
||||
export async function getAllTeachers(full: boolean): Promise<TeacherDTO[] | string[]> {
|
||||
const teacherRepository: TeacherRepository = getTeacherRepository();
|
||||
|
@ -40,7 +40,7 @@ export async function fetchTeacher(username: string): Promise<Teacher> {
|
|||
const user: Teacher | null = await teacherRepository.findByUsername(username);
|
||||
|
||||
if (!user) {
|
||||
throw new NotFoundException("Teacher with username not found");
|
||||
throw new NotFoundException('Teacher with username not found');
|
||||
}
|
||||
|
||||
return user;
|
||||
|
@ -86,7 +86,7 @@ export async function getClassesByTeacher(username: string, full: boolean): Prom
|
|||
export async function getStudentsByTeacher(username: string, full: boolean) {
|
||||
const classes: ClassDTO[] = await fetchClassesByTeacher(username);
|
||||
|
||||
if (!classes || classes.length === 0){
|
||||
if (!classes || classes.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ export async function getTeacherQuestions(username: string, full: boolean): Prom
|
|||
// Console.log(learningObjects)
|
||||
// TODO returns empty
|
||||
|
||||
if (!learningObjects || learningObjects.length === 0){
|
||||
if (!learningObjects || learningObjects.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@ -125,12 +125,12 @@ export async function getTeacherQuestions(username: string, full: boolean): Prom
|
|||
return questionsDTO.map(mapToQuestionId);
|
||||
}
|
||||
|
||||
export async function getJoinRequestsByClass( classId: string ): Promise<StudentRequestDTO[]> {
|
||||
export async function getJoinRequestsByClass(classId: string): Promise<StudentRequestDTO[]> {
|
||||
const classRepository: ClassRepository = getClassRepository();
|
||||
const cls: Class | null = await classRepository.findById(classId);
|
||||
|
||||
if (!cls) {
|
||||
throw new NotFoundException("Class with id not found");
|
||||
throw new NotFoundException('Class with id not found');
|
||||
}
|
||||
|
||||
const requestRepo: ClassJoinRequestRepository = getClassJoinRequestRepository();
|
||||
|
@ -138,7 +138,7 @@ export async function getJoinRequestsByClass( classId: string ): Promise<Student
|
|||
return requests.map(mapToStudentRequestDTO);
|
||||
}
|
||||
|
||||
export async function updateClassJoinRequestStatus( studentUsername: string, classId: string, accepted: boolean = true): Promise<void> {
|
||||
export async function updateClassJoinRequestStatus(studentUsername: string, classId: string, accepted: boolean = true): Promise<void> {
|
||||
const requestRepo: ClassJoinRequestRepository = getClassJoinRequestRepository();
|
||||
const classRepo: ClassRepository = getClassRepository();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue