Conversation
| _id: z.string().min(1), | ||
| itemId: z.string().min(1), | ||
| labId: z.string().min(1), | ||
| quantityAvailable: z.number().min(0), // can list items with 0 quantity? |
There was a problem hiding this comment.
We should have items listed with min of 1 quantity
| import Listing from "@/models/Listing"; | ||
|
|
||
| // test comment | ||
| // ask about whether users should provide _id, that seems more like a |
There was a problem hiding this comment.
We shouldn't include _id field since MongoDB will automatically generate and it is a db thing. I was a bit unclear in the task description, but yes, we shouldn't have a id field.
| } | ||
| } | ||
|
|
||
| // get all |
There was a problem hiding this comment.
nit: method headers should have a detailed comment about what it does. What is the input? output?
arnavjk007
left a comment
There was a problem hiding this comment.
I noticed this is on a different branch than the schema; we should have each service on its own branch, not each task. We can have everything related to listings in one branch, so schema and api changes would be done in the same branch. Please move these changes to the original listings branch and check if you can rename the branch to something like "listings_svc"
Describe your changes
[ Couple of bullet points ]
I have a couple questions about my implementation.
First off from the deliverables it said the schema should have the _id field. Just wondering how that would work since I wasn't sure if researchers would be the one providing the ids of their listings or we will.
Should we allow a listing with quantity as 0?
Then more of a developer choice, am I right to assume we shouldn't be displaying error information about our endpoints to users, just send a short readable message?
I had some of these questions commented in my code.
Issue ticket number and link
[ Insert Link & Ticket #]
Checklist before requesting a review