chicken-sloths / bangazon-api-sprint1

API for a mock Amazon + Etsy platform providing developers access to the company's employee & product data
0 stars 0 forks source link

Departments POST and PUT #98

Closed jordan-castelloe closed 6 years ago

jordan-castelloe commented 6 years ago

Description

This fixes Issue #7 , which asks for GET, POST, AND PUT on the Departments resource. (We don't need a delete function for this one!)

Number of Fixes

Fixes #7

Problem to Solve

This PR should provide post and put functionality for the Departments Resource

Expected Behavior

Steps to Test Solution

  1. Comment out all the routes EXCEPT the department route
  2. Run npm start in your terminal
  3. Open Postman

POST

  1. Type http://localhost:8080/api/v1/departments into Postman and set it to POST
  2. For the body, use: { "supervisor_id": 1, "expense_budget": 10000, "name": "woohoo!" }
  3. Post it!
  4. Run a GET request for http://localhost:8080/api/v1/departments/10 and you should see the data you just posted.

PUT

  1. Type http://localhost:8080/api/v1/departments/1 into Postman and set it to PUT
  2. For the body, use: { "supervisor_id": 1, "expense_budget": 10000, "name": "woohoo!" }
  3. Put it!
  4. Run a GET request for http://localhost:8080/api/v1/departments/1 and you should see the data you just posted.
DavidLarsKetch commented 6 years ago

testing