fix: interface bestanden enkelvoud
This commit is contained in:
parent
9c9e7c4870
commit
4968d7cb07
12 changed files with 20 additions and 20 deletions
|
@ -1,7 +1,7 @@
|
|||
import { Request, Response } from 'express'
|
||||
import { getAssignment } from '../services/assignments';
|
||||
|
||||
// typescript is annoywith with parameter forwarding from classes.ts
|
||||
// typescript is annoywith with parameter forwarding from class.ts
|
||||
interface AssignmentParams {
|
||||
classid: string;
|
||||
id: string;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Request, Response } from 'express';
|
||||
import {getAllClasses, getClass, getClassStudents, getClassStudentsIds} from '../services/class';
|
||||
import { ClassDTO } from '../interfaces/classes';
|
||||
import { ClassDTO } from '../interfaces/class';
|
||||
|
||||
export async function getAllClassesHandler(
|
||||
req: Request,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Request, Response } from 'express';
|
||||
import { getAllStudents, getStudent, getStudentClasses, getStudentClassIds } from '../services/students';
|
||||
import { ClassDTO } from '../interfaces/classes';
|
||||
import { ClassDTO } from '../interfaces/class';
|
||||
|
||||
// TODO: accept arguments (full, ...)
|
||||
// TODO: endpoints
|
||||
|
@ -27,7 +27,7 @@ export async function getStudentHandler(
|
|||
try {
|
||||
const username = req.params.id;
|
||||
const student = await getStudent(username);
|
||||
|
||||
|
||||
if (!student) {
|
||||
res.status(404).json({ error: "Student not found" });
|
||||
return;
|
||||
|
@ -72,4 +72,4 @@ export async function getStudentClassesHandler (
|
|||
console.error('Error fetching learning objects:', error);
|
||||
res.status(500).json({ error: 'Internal server error' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ import {
|
|||
getAllTeachersIds, getStudentsByTeacher, getStudentIdsByTeacher
|
||||
} from '../services/teachers.js';
|
||||
import {TeacherDTO} from "../interfaces/teacher";
|
||||
import {ClassDTO} from "../interfaces/classes";
|
||||
import {StudentDTO} from "../interfaces/students";
|
||||
import {ClassDTO} from "../interfaces/class";
|
||||
import {StudentDTO} from "../interfaces/student";
|
||||
|
||||
export async function getTeacherHandler(req: Request, res: Response): Promise<void> {
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue