mirror of
https://github.com/detleph/server.git
synced 2026-09-04 08:36:06 +02:00
added createRolesForTeam in register
This commit is contained in:
@@ -5,6 +5,7 @@ import { nanoid } from "nanoid";
|
||||
import { verificationMail } from "../lib/mail";
|
||||
import { DataType, generateInvalidBodyError } from "./common";
|
||||
import { generateTeamleaderJWT } from "../Middleware/auth/teamleaderAuth";
|
||||
import { createRolesForTeam } from "./role.controller";
|
||||
|
||||
interface CreateTeamBody {
|
||||
name: string;
|
||||
@@ -38,6 +39,9 @@ export const register = async (req: Request<{}, {}, CreateTeamBody>, res: Respon
|
||||
},
|
||||
});
|
||||
|
||||
//To do: maybe use returned amount of created use?
|
||||
createRolesForTeam(team.pid);
|
||||
|
||||
const usid = nanoid();
|
||||
|
||||
(await mailClient).set(usid, team.pid);
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import Express from "express";
|
||||
import { assignParticipantToRole } from "../Controllers/role.controller";
|
||||
|
||||
const router = Express.Router();
|
||||
|
||||
router.patch<"/:pid/", { pid: string }>("/:pid/", assignParticipantToRole)
|
||||
Reference in New Issue
Block a user