Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.put('/buku/:id', async (req, res) => {
- try {
- let id = req.params.id;
- let judul = req.body.judul;
- let sinopsis = req.body.sinopsis;
- let penulis = req.body.penulis;
- await knex('buku').where('id', id).update({
- "judul": judul,
- "sinopsis": sinopsis,
- "penulis": penulis
- })
- res.json({
- id,
- judul,
- sinopsis,
- penulis
- })
- } catch (e) {
- console.log(e);
- next(e)
- }
- })
Add Comment
Please, Sign In to add comment