Fix scouthub-home-be
This commit is contained in:
@@ -20,12 +20,6 @@ function parseCreaInvitoBody(body: PostInvitoBody): { email: string; ruolo: stri
|
||||
export async function postInvito(req: Request, res: Response, next: NextFunction): Promise<void> {
|
||||
try {
|
||||
const { orgId } = req.params;
|
||||
|
||||
// Un capo gruppo può invitare solo all'interno della propria organization.
|
||||
if (req.auth?.organizationId !== orgId) {
|
||||
throw new HttpError(403, "Non puoi invitare persone in un'organizzazione diversa dalla tua");
|
||||
}
|
||||
|
||||
const { email, ruolo } = parseCreaInvitoBody(req.body ?? {});
|
||||
const result = await creaInvito({ orgId, email, ruolo });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user