Created
June 1, 2020 18:10
-
-
Save kauemurakami/5f59a8e614d7347e2725f4222e50c5cd to your computer and use it in GitHub Desktop.
atualizando registro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const updateUser = async (req: Request, res: Response) => { | |
const body = await req.body() | |
if (Client.select('id', '===', req.params.id)) { | |
await Client.where('id', req.params.id).update({ name: body.value.name, email: body.value.email }) | |
res.status(200).send({ clients: Client.all() }) | |
}else{ | |
res.status(404).send({ message: "usuário não encontrado" }) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment