sending new group id in response to group creation

This commit is contained in:
leca 2024-11-02 12:45:36 +03:00
parent 02b1a572d1
commit c869f7c6ac
1 changed files with 3 additions and 2 deletions

View File

@ -13,12 +13,13 @@ class GroupController {
let { groupName } = req.params;
let user = jwt.decode(req.headers.authorization.split(' ')[1], config.secret);
let status = await GroupService.create(groupName, user.login.id);
let group = await GroupService.create(groupName, user.login.id);
log.info(`New group with name ${groupName} was just created by user ${user.login.username}`);
await UserService.joinGroup(user.login.id, status.id);
return res.status(200).send(translate(req.headers["accept-language"], responseCodes.responses.general.ok));
// return res.status(200).send(translate(req.headers["accept-language"], responseCodes.responses.general.ok));
return res.status(200).send(group.id.toString())
}
async join(req, res) {
let { groupId } = req.params;