style: fix linting issues met Prettier
This commit is contained in:
parent
fc5a40ba40
commit
9b0c0c9889
11 changed files with 43 additions and 45 deletions
|
@ -1,18 +1,19 @@
|
|||
import { Request, Response } from 'express';
|
||||
import {
|
||||
createStudent,
|
||||
deleteStudent, getAllStudentIds,
|
||||
deleteStudent,
|
||||
getAllStudentIds,
|
||||
getAllStudents,
|
||||
getStudent,
|
||||
getStudentAssignments,
|
||||
getStudentClasses,
|
||||
getStudentGroups, getStudentQuestions,
|
||||
getStudentGroups,
|
||||
getStudentQuestions,
|
||||
getStudentSubmissions,
|
||||
} from '../services/students.js';
|
||||
import {MISSING_FIELDS_ERROR, MISSING_USERNAME_ERROR, NAME_NOT_FOUND_ERROR} from './users.js';
|
||||
import { MISSING_FIELDS_ERROR, MISSING_USERNAME_ERROR, NAME_NOT_FOUND_ERROR } from './users.js';
|
||||
import { StudentDTO } from '../interfaces/student.js';
|
||||
|
||||
|
||||
export async function getAllStudentsHandler(req: Request, res: Response): Promise<void> {
|
||||
const full = req.query.full === 'true';
|
||||
|
||||
|
@ -23,7 +24,7 @@ export async function getAllStudentsHandler(req: Request, res: Response): Promis
|
|||
return;
|
||||
}
|
||||
|
||||
res.json({students});
|
||||
res.json({ students });
|
||||
}
|
||||
|
||||
export async function getStudentHandler(req: Request, res: Response): Promise<void> {
|
||||
|
@ -152,5 +153,5 @@ export async function getStudentQuestionsHandler(req: Request, res: Response): P
|
|||
|
||||
res.json({
|
||||
questions,
|
||||
})
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,17 +1,10 @@
|
|||
import { Request, Response } from 'express';
|
||||
import {
|
||||
createTeacher,
|
||||
deleteTeacher,
|
||||
getAllTeachers,
|
||||
getClassesByTeacher,
|
||||
getStudentsByTeacher,
|
||||
getTeacher,
|
||||
} from '../services/teachers.js';
|
||||
import { createTeacher, deleteTeacher, getAllTeachers, getClassesByTeacher, getStudentsByTeacher, getTeacher } from '../services/teachers.js';
|
||||
import { ClassDTO } from '../interfaces/class.js';
|
||||
import { StudentDTO } from '../interfaces/student.js';
|
||||
import { QuestionDTO, QuestionId } from '../interfaces/question.js';
|
||||
import { TeacherDTO } from '../interfaces/teacher.js';
|
||||
import {MISSING_FIELDS_ERROR, MISSING_USERNAME_ERROR, NAME_NOT_FOUND_ERROR} from "./users";
|
||||
import { MISSING_FIELDS_ERROR, MISSING_USERNAME_ERROR, NAME_NOT_FOUND_ERROR } from './users';
|
||||
|
||||
export async function getAllTeachersHandler(req: Request, res: Response): Promise<void> {
|
||||
const full = req.query.full === 'true';
|
||||
|
@ -23,7 +16,7 @@ export async function getAllTeachersHandler(req: Request, res: Response): Promis
|
|||
return;
|
||||
}
|
||||
|
||||
res.json({teachers});
|
||||
res.json({ teachers });
|
||||
}
|
||||
|
||||
export async function getTeacherHandler(req: Request, res: Response): Promise<void> {
|
||||
|
@ -98,7 +91,7 @@ export async function getTeacherStudentHandler(req: Request, res: Response): Pro
|
|||
|
||||
const students: StudentDTO[] | string[] = await getStudentsByTeacher(username, full);
|
||||
|
||||
res.json({students});
|
||||
res.json({ students });
|
||||
}
|
||||
|
||||
export async function getTeacherQuestionHandler(req: Request, res: Response): Promise<void> {
|
||||
|
@ -112,5 +105,5 @@ export async function getTeacherQuestionHandler(req: Request, res: Response): Pr
|
|||
|
||||
const questions: QuestionDTO[] | QuestionId[] = await getQuestionsByTeacher(username, full);
|
||||
|
||||
res.json({questions});
|
||||
res.json({ questions });
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
export const MISSING_USERNAME_ERROR = { error: 'Missing required field: username' };
|
||||
|
||||
export function NAME_NOT_FOUND_ERROR(username: string){
|
||||
return {error: `User with username '${username}' not found.`};
|
||||
export function NAME_NOT_FOUND_ERROR(username: string) {
|
||||
return { error: `User with username '${username}' not found.` };
|
||||
}
|
||||
|
||||
export const MISSING_FIELDS_ERROR = { error: 'Missing required fields: username, firstName, lastName'}
|
||||
export const MISSING_FIELDS_ERROR = { error: 'Missing required fields: username, firstName, lastName' };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue