nesh170 / asap-inventory-system

This is a concept inventory system for ECE458. It is built by ASAPsolutions
1 stars 0 forks source link

Creating CRUD Items API #30

Closed nesh170 closed 7 years ago

nesh170 commented 7 years ago

Create 👍

nesh170 commented 7 years ago

Get all Items:- GET http://localhost:8000/item Returns all the items

Create a new Item:- POST http://localhost:8000/item

{
    "name": "siva",
    "quantity": 2,
    "model_number": "12344567",
    "description": "This is super lit",
    "location": "Hudson",
    "tags": [{"tag": "first tag"}, {"tag": "second tag"}]
}

Get detailed Item:- GET http://localhost:8000/item/'id'

Delete detailed Item:- DELETE http://localhost:8000/item/'id'

Update detailed Item:- PATCH http://localhost:8000/item/'id'

{
    "name": "siva",
    "quantity": 2,
    "model_number": "12344567",
    "description": "This is super lit",
    "location": "Hudson"
}

If you leave out any attribute in the JSON it will not be updated :D so nothing is required. Tags cannot be updated

Create a new Tag POST http://localhost:8000/item/tag/

{
      "item": 1,
      "tag": "kamehameha"
    }

item is the item id

Delete a Tag DELETE http://localhost:8000/item/tag/'id'

nesh170 commented 7 years ago

PR:- https://github.com/nesh170/asap-inventory-system/pull/36

nesh170 commented 7 years ago

Merged :D