Closed kenziebottoms closed 6 years ago
Adds the following endpoints:
GET /training-programs
GET /training-programs/:id
POST /training-programs
PUT /training-programs/:id
DELETE /training-programs/:id
fixes #59, fixes #9
npm run db:generate
Brand 101
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"}
10
PUT http://localhost:8080/api/v1/training-programs/3
3
PUT http://localhost:8080/api/v1/training-programs/31
31
DELETE http://localhost:8080/api/v1/training-programs/31
testing!
Description
Adds the following endpoints:
GET /training-programs
: gets all training programsGET /training-programs/:id
: gets one training program by idPOST /training-programs
: posts new training programPUT /training-programs/:id
: replaces/updates one training program by idDELETE /training-programs/:id
: removes one training program by idRelated Ticket(s)
fixes #59, fixes #9
Steps to Test Solution
npm run db:generate
Brand 101
POST http://localhost:8080/api/v1/training-programs
:10
and http://localhost:8080/api/v1/training-programs/10 should now give you the Star Wars training programPUT http://localhost:8080/api/v1/training-programs/3
:3
and http://localhost:8080/api/v1/training-programs/3 should now give you the Star Wars training programPUT http://localhost:8080/api/v1/training-programs/31
:31
and http://localhost:8080/api/v1/training-programs/31 should now give you the Star Wars training programDELETE http://localhost:8080/api/v1/training-programs/31
should return31
and http://localhost:8080/api/v1/training-programs/31 should now give you a "Training program not found" error