feat: class/:id service en controller laag geimplementeerd (BEVAT NOG BUG)
This commit is contained in:
parent
ceef74f1af
commit
e9d9e52f9d
5 changed files with 60 additions and 33 deletions
12
backend/src/services/class.ts
Normal file
12
backend/src/services/class.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { getClassRepository } from "../data/repositories";
|
||||
import { ClassDTO, mapToClassDTO } from "../interfaces/classes";
|
||||
|
||||
export async function getClass(classId: string): Promise<ClassDTO | null> {
|
||||
const classRepository = getClassRepository();
|
||||
const cls = await classRepository.findById(classId);
|
||||
|
||||
if (!cls) return null;
|
||||
else {
|
||||
return mapToClassDTO(cls);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue