invite management
This commit is contained in:
parent
d1cf9f4c66
commit
c66c847ec1
6 changed files with 87 additions and 20 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue