invite management

This commit is contained in:
Julian Krauser 2024-11-24 12:36:12 +01:00
parent d1cf9f4c66
commit c66c847ec1
6 changed files with 87 additions and 20 deletions

View file

@ -3,6 +3,23 @@ import { invite } from "../entity/invite";
import InternalException from "../exceptions/internalException";
export default abstract class InviteService {
/**
* @description get all invites
* @returns {Promise<Array<invite>>}
*/
static async getAll(): Promise<Array<invite>> {
return await dataSource
.getRepository(invite)
.createQueryBuilder("invite")
.getMany()
.then((res) => {
return res;
})
.catch((err) => {
throw new InternalException("invites not found", err);
});
}
/**
* @description get invite by id
* @param mail string