fix: juiste responsecodes en messages toegevoegd
This commit is contained in:
parent
59e8f2fcf2
commit
1664642940
9 changed files with 61 additions and 17 deletions
|
@ -21,7 +21,7 @@ export async function getAllAssignments(classid: string, full: boolean): Promise
|
|||
return assignments.map(mapToAssignmentDTOId);
|
||||
}
|
||||
|
||||
export async function createAssignment(classid: string, assignmentData: AssignmentDTO): Promise<Assignment | null> {
|
||||
export async function createAssignment(classid: string, assignmentData: AssignmentDTO): Promise<AssignmentDTO | null> {
|
||||
const classRepository = getClassRepository();
|
||||
const cls = await classRepository.findById(classid);
|
||||
|
||||
|
@ -36,7 +36,7 @@ export async function createAssignment(classid: string, assignmentData: Assignme
|
|||
const newAssignment = assignmentRepository.create(assignment);
|
||||
await assignmentRepository.save(newAssignment);
|
||||
|
||||
return newAssignment;
|
||||
return mapToAssignmentDTO(newAssignment);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue