Add teams to a user when they are created
This commit is contained in:
1 parent
a6f5c96f93
commit
c39eab49bd
8 files changed
+26
-8
No files matched your search
@@ -226,7 +226,8 @@ const inviteController = async (req, res, next) => {
|
||||
try {
|
||||
// Only admins can invite
|
||||
const token = getTokenFromHeaders(req.headers);
|
||||
const { role, firstname } = jwt.decode(token);
|
||||
const { role, firstname, teamId } = jwt.decode(token);
|
||||
req.body.teamId = teamId;
|
||||
try {
|
||||
await inviteRoleValidation.validateAsync({ roles: role });
|
||||
await inviteBodyValidation.validateAsync(req.body);
|
||||
|
||||
Reference in new issue
Block a user