Skip to content

Commit

Permalink
api for removing user
Browse files Browse the repository at this point in the history
  • Loading branch information
thakursachin467 committed Nov 22, 2018
1 parent 3c7f1ff commit f3a7f2e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions api/routes/rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,26 @@ router.post('/delete/:id', (req, res) => {
})
});

router.post('/removeUser/:id', (req, res) => {
const roomId = req.params.id;
const userId = req.body.userId
chatkit.removeUsersFromRoom({
roomId: Number(roomId),
userIds: [userId]
})
.then(() => {
res.status(200).send({
success: true
})
console.log('removed')
})
.catch(err => {
res.status(400).send({
success: false
})
console.error(err)
})
});


module.exports = router;

0 comments on commit f3a7f2e

Please sign in to comment.