sgwalker327/rails_engine

#10 Part 3/S1: RESTful: Update an Item

Closed this issue · 0 comments

This endpoint should:

update the corresponding Item (if found) with whichever details are provided by the user
render a JSON representation of the updated record.
follow this pattern: PATCH /api/v1/items/:id
accept the following JSON body with one or more of the following fields: The body should follow this pattern:
{
"name": "value1",
"description": "value2",
"unit_price": 100.99,
"merchant_id": 7
}
(Note that the unit price is to be sent as a numeric value, not a string.)

Example JSON response for the Item resource:

{
"data": {
"id": "1",
"type": "item",
"attributes": {
"name": "New Widget Name",
"description": "High quality widget, now with more widgety-ness",
"unit_price": 299.99,
"merchant_id": 7
}
}
}