Skip to content

feat: Create route to update details of a book by its Id #6

@MahendraDani

Description

@MahendraDani

Description

Users should be able to update some or all details of a book by its id. The request body may be different for all use cases. Users should be able to update one or more than one property of a book

Difficulty

  • Advanced
  • 50 Points

API Endpoint

PUT http://localhost:3000/books/update/:id

Controller

/controllers/books/updateBook.js

Request Params

  • id

Request Body

  • title
  • subtitle
  • description
  • author
  • publisher
  • publishedOn
  • pages
  • website

Response

{status : 200,
message : "Book updated successfully"
book : {
            "isbn":"9781593279509",
            "title":"Eloquent JavaScript, Third Edition",
            "subtitle":"A Modern Introduction to Programming",
            "author":"Marijn Haverbeke",
            "published":"2018-12-04T00:00:00.000Z",
            "publisher":"No Starch Press",
            "pages":472,
            "description":"JavaScript lies at the heart of almost every modern web application, from social apps like Twitter to browser-based game frameworks like Phaser and Babylon. Though simple for beginners to pick up and play with, JavaScript is a flexible, complex language that you can use to build full-scale applications.",
            "website":"http://eloquentjavascript.net/"
        },

Metadata

Metadata

Assignees

No one assigned

    Labels

    Advanced50 Reward points

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions