Update Book
To edit the data in the specified collection with the specified parameters. When a JSON object is saved, the object properties are automatically added to the collection you specified.
Method : PUT
URL : /api/book
Body : JSON
{
"id": 301,
"author_id": 216,
"title": "New Book Title Edit",
"isbn": "9780441627400 Edit",
"language": "English Edit",
"pages": "639 Edit",
"published": "1958-02-02",
"link": "New Book Link Edit",
"image": "New Book Image Edit",
"description": "New Book Description Edit",
"genre": [
{
"value": 1,
"label": "a Edit"
},
{
"value": 2,
"label": "b Edit"
}
]
}
id*Required
number
Book ID.
title*Required
string
Book title.
author_id
number
Book author ID.
isbn
string
Book ISBN.
language
string
Book language.
pages
string
Book total page.
published
string (date)
Book published date.
link
string
Book goodread link.
image
string
Book image URL
description
string
Book description
genre
array of object
Book genres.
[
{
"value": "ID of Genre"
},
{
"value": "ID of Genre"
}
]
Response : 200 - OK
{
"message": "Success update book"
}
Response : 422 - Unprocessable Content
{
"error": "Title required"
}
Response : 404 - Not Found
Not Found
Response : 500 - Server Error
Internal Server Error