sending new group id in response to group creation
This commit is contained in:
parent
02b1a572d1
commit
c869f7c6ac
|
@ -13,12 +13,13 @@ class GroupController {
|
||||||
let { groupName } = req.params;
|
let { groupName } = req.params;
|
||||||
|
|
||||||
let user = jwt.decode(req.headers.authorization.split(' ')[1], config.secret);
|
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}`);
|
log.info(`New group with name ${groupName} was just created by user ${user.login.username}`);
|
||||||
|
|
||||||
await UserService.joinGroup(user.login.id, status.id);
|
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) {
|
async join(req, res) {
|
||||||
let { groupId } = req.params;
|
let { groupId } = req.params;
|
||||||
|
|
Loading…
Reference in New Issue