The remove controller method deletes the specified game from the database, when a DELETE request is received at '/api/games/:gameId' and it has been verified that the current user is the original maker of the given game.
mern-vrgame/server/controllers/game.controller.js:
const remove = (req, res) => { let game = req.game game.remove((err, deletedGame) => { if(err) { return res.status(400).json({ error: errorHandler.getErrorMessage(err) }) } res.json(deletedGame) })}