Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inventory endpoints #23

Merged
merged 1 commit into from
Nov 25, 2024
Merged

inventory endpoints #23

merged 1 commit into from
Nov 25, 2024

Conversation

up2code3
Copy link
Collaborator

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"
}

click send

“Update a med” → PATCH > /inventory/343535435344 > follow the same syntax as above but only include 1 field.
{

"batchCode": "A22222222222"

}

click send

“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.

Copy link
Collaborator

@vsrodriguez3 vsrodriguez3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!!

@up2code3 up2code3 merged commit 4f1159e into main Nov 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants