async update(req, res) { if(!req.params.id || !req.body.name) { res.status(400); res.json({ success: false, message: 'Bad request' }); } const id = req.params.id; const conn = await getConnection(); await updateEmployee(conn, req.body, id); const employee = await getEmployee(conn, id); res.status(200); res.json({ success: true, body: employee, message: 'Ok' }); }