From c869f7c6ac4027b0bb14473658b521e97561840a Mon Sep 17 00:00:00 2001 From: leca Date: Sat, 2 Nov 2024 12:45:36 +0300 Subject: [PATCH] sending new group id in response to group creation --- src/controllers/group.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controllers/group.js b/src/controllers/group.js index 373b500..b5a0e17 100644 --- a/src/controllers/group.js +++ b/src/controllers/group.js @@ -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;