Closed dvidsilva closed 7 years ago
Creates a model for Food Requests with its validator, basic tests and endpoints.
It should use a different database to run the tests, to avoid corrupt data, or delete the documents that are successfully created. As mentioned in #10
We added the following packages or dependencies:
To create a new food request, run the application and make a POST request to /api/request with the following body:
/api/request
{"data": {"name":"David Silva","agency":"Tech For PR","email":"techforpr@example.com","phone":"xxx-xxx-xxxx","address":"123 fake st, apt 2","zipcode":"11001","questions":{"amountOfPeople":10},"needs":{"breakfast":10,"lunch":10,"dinner":10}}}
It should successfully create a request and return the doc, you can remove some data to try and create an invalid one and see the error.
Use the shortId from the previous doc and make a GET request to localhost:3000/api/request/:shortId to verify that the other endpoint works.
localhost:3000/api/request/:shortId
It allows to create new food requests so the client can use them later.
Solves issue Number: 3
Description:
Creates a model for Food Requests with its validator, basic tests and endpoints.
Todos
It should use a different database to run the tests, to avoid corrupt data, or delete the documents that are successfully created. As mentioned in #10
Deploy Notes
We added the following packages or dependencies:
Steps to Test or Reproduce
To create a new food request, run the application and make a POST request to
/api/request
with the following body:It should successfully create a request and return the doc, you can remove some data to try and create an invalid one and see the error.
Use the shortId from the previous doc and make a GET request to
localhost:3000/api/request/:shortId
to verify that the other endpoint works.Impacted Areas in Application
It allows to create new food requests so the client can use them later.