refactor(backend): Functions
This commit is contained in:
parent
5ec62554e3
commit
65c1a5e6b6
57 changed files with 172 additions and 117 deletions
|
@ -4,16 +4,16 @@ import { TeacherInvitation } from '../../entities/classes/teacher-invitation.ent
|
|||
import { Teacher } from '../../entities/users/teacher.entity.js';
|
||||
|
||||
export class TeacherInvitationRepository extends DwengoEntityRepository<TeacherInvitation> {
|
||||
public findAllInvitationsForClass(clazz: Class): Promise<TeacherInvitation[]> {
|
||||
public async findAllInvitationsForClass(clazz: Class): Promise<TeacherInvitation[]> {
|
||||
return this.findAll({ where: { class: clazz } });
|
||||
}
|
||||
public findAllInvitationsBy(sender: Teacher): Promise<TeacherInvitation[]> {
|
||||
public async findAllInvitationsBy(sender: Teacher): Promise<TeacherInvitation[]> {
|
||||
return this.findAll({ where: { sender: sender } });
|
||||
}
|
||||
public findAllInvitationsFor(receiver: Teacher): Promise<TeacherInvitation[]> {
|
||||
public async findAllInvitationsFor(receiver: Teacher): Promise<TeacherInvitation[]> {
|
||||
return this.findAll({ where: { receiver: receiver } });
|
||||
}
|
||||
public deleteBy(clazz: Class, sender: Teacher, receiver: Teacher): Promise<void> {
|
||||
public async deleteBy(clazz: Class, sender: Teacher, receiver: Teacher): Promise<void> {
|
||||
return this.deleteWhere({
|
||||
sender: sender,
|
||||
receiver: receiver,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue