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

`/training-programs` endpoints #105

Closed kenziebottoms closed 6 years ago

kenziebottoms commented 6 years ago

Description

Adds the following endpoints:

Related Ticket(s)

fixes #59, fixes #9

Steps to Test Solution

  1. npm run db:generate
  2. comment out non-training program routes
  3. http://localhost:8080/api/v1/training-programs should give you training programs with ids 0-9
  4. http://localhost:8080/api/v1/training-programs/3 should give you a training program called Brand 101
  5. POST http://localhost:8080/api/v1/training-programs:
    {"max_capacity":17,"start_date":"2017-11-23T21:57:41.704Z","end_date":"2018-02-20T02:15:39.657Z","name":"Star Wars 101"}
  6. should return 10 and http://localhost:8080/api/v1/training-programs/10 should now give you the Star Wars training program
  7. PUT http://localhost:8080/api/v1/training-programs/3:
    {"max_capacity":17,"start_date":"2017-11-23T21:57:41.704Z","end_date":"2018-02-20T02:15:39.657Z","name":"Star Wars 101"}
  8. should return 3 and http://localhost:8080/api/v1/training-programs/3 should now give you the Star Wars training program
  9. PUT http://localhost:8080/api/v1/training-programs/31:
    {"max_capacity":17,"start_date":"2017-11-23T21:57:41.704Z","end_date":"2018-02-20T02:15:39.657Z","name":"Star Wars 101"}
  10. should return 31 and http://localhost:8080/api/v1/training-programs/31 should now give you the Star Wars training program
  11. DELETE http://localhost:8080/api/v1/training-programs/31 should return 31 and http://localhost:8080/api/v1/training-programs/31 should now give you a "Training program not found" error
DavidLarsKetch commented 6 years ago

testing!

jordan-castelloe commented 6 years ago

testing!