invite management
This commit is contained in:
parent
d1cf9f4c66
commit
c66c847ec1
6 changed files with 87 additions and 20 deletions
|
@ -18,6 +18,7 @@ import CustomRequestException from "../exceptions/customRequestException";
|
|||
import { CLUB_NAME } from "../env.defaults";
|
||||
import { CreateUserPermissionCommand } from "../command/userPermissionCommand";
|
||||
import UserPermissionCommandHandler from "../command/userPermissionCommandHandler";
|
||||
import InviteFactory from "../factory/admin/invite";
|
||||
|
||||
/**
|
||||
* @description get all invites
|
||||
|
@ -25,7 +26,11 @@ import UserPermissionCommandHandler from "../command/userPermissionCommandHandle
|
|||
* @param res {Response} Express res object
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function getInvites(req: Request, res: Response): Promise<any> {}
|
||||
export async function getInvites(req: Request, res: Response): Promise<any> {
|
||||
let invites = await InviteService.getAll();
|
||||
|
||||
res.json(InviteFactory.mapToBase(invites));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description start first user
|
||||
|
@ -157,11 +162,15 @@ export async function finishInvite(req: Request, res: Response, grantAdmin: bool
|
|||
}
|
||||
|
||||
/**
|
||||
* @description delete invites
|
||||
* @description delete invite by mail
|
||||
* @param req {Request} Express req object
|
||||
* @param res {Response} Express res object
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function deleteInvites(req: Request, res: Response): Promise<any> {
|
||||
const id = parseInt(req.params.id);
|
||||
export async function deleteInvite(req: Request, res: Response): Promise<any> {
|
||||
const mail = req.params.mail;
|
||||
|
||||
await InviteCommandHandler.deleteByMail(mail);
|
||||
|
||||
res.sendStatus(204);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue