2025SELab2-project-Dwengo/backend/src/data/assignments/assignment-repository.ts
Gerald Schmittinger 73a84fa3ef fix(backend): .js aan alle imports toegevoegd
Dit was nodig om ervoor te zorgen dat de gebouwde applicatie ook haar dependencies vindt.
2025-02-26 22:43:16 +01:00

18 lines
751 B
TypeScript

import { DwengoEntityRepository } from '../dwengo-entity-repository.js';
import { Assignment } from '../../entities/assignments/assignment.entity.js';
import { Class } from '../../entities/classes/class.entity.js';
export class AssignmentRepository extends DwengoEntityRepository<Assignment> {
public findByClassAndId(
within: Class,
id: number
): Promise<Assignment | null> {
return this.findOne({ within: within, id: id });
}
public findAllAssignmentsInClass(within: Class): Promise<Assignment[]> {
return this.findAll({ where: { within: within } });
}
public deleteByClassAndId(within: Class, id: number): Promise<void> {
return this.deleteWhere({ within: within, id: id });
}
}