Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
1) What does this PR do? 2) List out what you did.
Created End points for inventory
_Provide a link to the related issue
Creation
Feature update/change/addition, bug fix, styling update, etc.
Acceptance Criteria
Include the checked-off acceptance criteria from the issue.
Update Screenshots
Provide screenshots of the view before and after the changes.
Before
After
Testing Instructions
For testing routes
Npm run dev
In postman set url as base variable as → http://localhost:8000/api/v1
“Get all meds” → GET > /inventory > click send
“Get A med” → GET > /inventory/4738473743647 > click send
(must have valid “_id” from get all page, above is example)
“Create a med” → POST > /inventory > then in the body tab (raw) , enter info in the following syntax, below is example info. Type must be chosen from the enum values set in the medication model.
{
"name": "Amoxicillin",
"batchCode": "A43434",
"expirationDate": "2075-12-31",
"type": "Antibiotic"
}
“Update a med” → PATCH > /inventory/343535435344 > follow the same syntax as above but only include 1 field.
{
"batchCode": "A22222222222"
}
“Delete Med” → DELETE > /inventory/434793249727 > click send , the med with that id will be deleted from the database
Learnings (Optional)
Document any things you learned or 'gotchas' you experienced.