fix(backend): Kleinere fouten opgelost.
This commit is contained in:
parent
6e7a03f55b
commit
f199ceb945
3 changed files with 4 additions and 5 deletions
|
@ -1,7 +1,6 @@
|
||||||
import { Request, Response } from 'express';
|
import { Request, Response } from 'express';
|
||||||
import { createClass, getAllClasses, getClass, getClassStudents, getClassStudentsIds, getClassTeacherInvitations } from '../services/class.js';
|
import { createClass, getAllClasses, getClass, getClassStudents, getClassStudentsIds, getClassTeacherInvitations } from '../services/class.js';
|
||||||
import { ClassDTO, mapToClass } from '../interfaces/class.js';
|
import { ClassDTO } from '../interfaces/class.js';
|
||||||
import { getClassRepository, getStudentRepository, getTeacherRepository } from '../data/repositories.js';
|
|
||||||
|
|
||||||
export async function getAllClassesHandler(req: Request, res: Response): Promise<void> {
|
export async function getAllClassesHandler(req: Request, res: Response): Promise<void> {
|
||||||
const full = req.query.full === 'true';
|
const full = req.query.full === 'true';
|
||||||
|
@ -38,7 +37,7 @@ export async function getClassHandler(req: Request, res: Response): Promise<void
|
||||||
const cls = await getClass(classId);
|
const cls = await getClass(classId);
|
||||||
|
|
||||||
if (!cls) {
|
if (!cls) {
|
||||||
res.status(404).json({ error: 'Student not found' });
|
res.status(404).json({ error: 'Class not found' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cls.endpoints = {
|
cls.endpoints = {
|
||||||
|
|
|
@ -59,7 +59,7 @@ export async function createGroupHandler(req: Request, res: Response): Promise<v
|
||||||
}
|
}
|
||||||
|
|
||||||
const groupData = req.body as GroupDTO;
|
const groupData = req.body as GroupDTO;
|
||||||
const group = createGroup(groupData, classid, assignmentId);
|
const group = await createGroup(groupData, classid, assignmentId);
|
||||||
|
|
||||||
if (!group) {
|
if (!group) {
|
||||||
res.status(500).json({ error: 'Something went wrong while creating group' });
|
res.status(500).json({ error: 'Something went wrong while creating group' });
|
||||||
|
|
|
@ -18,7 +18,7 @@ export class Submission {
|
||||||
@PrimaryKey({ type: 'numeric' })
|
@PrimaryKey({ type: 'numeric' })
|
||||||
learningObjectVersion: number = 1;
|
learningObjectVersion: number = 1;
|
||||||
|
|
||||||
@PrimaryKey({ type: 'integer' })
|
@PrimaryKey({ type: 'integer', autoincrement: true })
|
||||||
submissionNumber!: number;
|
submissionNumber!: number;
|
||||||
|
|
||||||
@ManyToOne({
|
@ManyToOne({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue