Completing Listing REST endpoints for GET all and POST#7
Completing Listing REST endpoints for GET all and POST#7
Conversation
arnavjk007
left a comment
There was a problem hiding this comment.
We will also have it where only certain roles can create listings or ping these APIs. So just keep note or maybe comment as a reminder to implement user auth and permissions once that is implemented. For example, only lab admins can create or delete listings so we need to check permissions before we do the process.
…tion for GET requests
arnavjk007
left a comment
There was a problem hiding this comment.
Some minor changes + sorting changes
…now, created indexing for filters in schema file
arnavjk007
left a comment
There was a problem hiding this comment.
Restructuring change for consistency across all services
…w requested changes
There was a problem hiding this comment.
This looks good, I think the final thing we need is a little bit of unit testing to make sure that the apis work properly. I set up jest on the main branch so make sure to do git merge main in your feat branch to get the updates. Unit testing goes into each folder and creates a new tests file with .test.ts.
arnavjk007
left a comment
There was a problem hiding this comment.
Okay I think there is a little confusion abt file structure for tests. In every folder you have a file that needs testing, just create its own tests folder there, here you are creating unit test files in the lib/tests folder which is only meant to test mongoose.
- So for your listings.id.route.test.ts, you would create a tests folder in app/api/listings folder and put all route relate testing there.
- For services, same thing you would go into services/listings and make a tests with all unit tests testing in your listings.ts file in services.
- We don't commit coverage files as that is just for you to look at when you run tests so I would add everything relate to coverage into your .gitignore.
- We also need testing on each function I only saw it for the get filtered and a post
Describe your changes
Issue ticket number and link
[ Insert Link & Ticket #]
Checklist before requesting a review