SDN302_-_PE_-_SP_2025_-_Block_5_3837.webp
Y

SDN302_-_PE_-_SP_2025_-_Block_5_3837.webp

  • Media owner Yuji99
  • Ngày thêm
Kizspy.me
Question 2 (2 points) - Update a Book by ID
Objective:
Create a REST API to update an existing book by its ID. The request may include updated
title, author, genres, published Year, or availableCopies.
⚫ Endpoint: PUT /api/books/:id
Processing Requirements:
。 Validate that the book with the given ID exists.
。 Validate that any provided author and genre IDs exist in their collections.
o Update the relevant fields.
o Return the updated book document.
• Request Example:
{
"title": "Refactoring (2nd Edition)",
"author": "66211aaa12bcab1234567788",
"genres":["66211aaa12bcab1234567711", "66211aaa12bcab1234567722"],
"publishedYear": 2019,
"availableCopies": 6
Zoom
+ 100%
Close
Chưa có bình luận nào.

Thông tin

Category
SDN302
Thêm bởi
Yuji99
Ngày thêm
Lượt xem
1,013
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom