Fix scouthub-home-be

This commit is contained in:
Lorenzo Sanesi
2026-07-25 12:09:12 +02:00
parent ac92ca43ce
commit 5b7c82d359
39 changed files with 2116 additions and 81 deletions
@@ -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 });