The edit API is called in the view using a fetch method that takes the form data and sends it with the request to the backend along with user credentials.
mern-vrgame/client/game/api-game.js:
const update = (params, credentials, game) => { return fetch('/api/games/' + params.gameId, { method: 'PUT', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + credentials.t }, body: JSON.stringify(game) }).then((response) => { return response.json() }).catch((err) => { console.log(err) }) }