Guest User

Untitled

a guest
Feb 15th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. app.put('/buku/:id', async (req, res) => {
  2. try {
  3. let id = req.params.id;
  4. let judul = req.body.judul;
  5. let sinopsis = req.body.sinopsis;
  6. let penulis = req.body.penulis;
  7.  
  8. await knex('buku').where('id', id).update({
  9. "judul": judul,
  10. "sinopsis": sinopsis,
  11. "penulis": penulis
  12. })
  13. res.json({
  14. id,
  15. judul,
  16. sinopsis,
  17. penulis
  18. })
  19. } catch (e) {
  20. console.log(e);
  21. next(e)
  22. }
  23. })
Add Comment
Please, Sign In to add comment