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

Kaikanes-Routes/Controllers for updating name and unit of measurement #630

Merged

Conversation

lacnoskillz
Copy link
Contributor

@lacnoskillz lacnoskillz commented Dec 1, 2023

Description

Created controller functions and routes to give users the ability to update the inventorytype unit of measurement and name

Related PRS (if any):

Front ed still work in progress

Main changes explained:

  • Added two more functions to bmInventoryTypeController
  • First one gets a single inventorytype
  • second one updates the name and unit of measurement
  • also created routes in bmInventoryTypeRouter.js to use new controller functions

How to test:

  1. check into current branch
  2. do npm install and npm run build to run this PR locally
  3. Clear site data/cache
  4. localhost:4500/api/bm/invtypes/materials/ and get a id
  5. test localhost:4500/api/bm/invtypes/material/:id get and put routes
  6. params are {"name" : "updated name", "unit": "updated unit"}
  7. You should be able to get a single inventory type and update the name and unit

Screenshots or videos of changes:

2023-12-01.12-29-42.mp4

Note:

Dont forget to add your headers
You can get your auth token in local storage when you log in.
image

@lacnoskillz lacnoskillz changed the title remake branch without package-lock.json modifications Kaikanes-Routes/Controllers for updating name and unit of measurement Dec 1, 2023
@ljrirene
Copy link

ljrirene commented Dec 3, 2023

Hi Kaikanes, I got this error here. Does this PR need any extra setting?
image

@lacnoskillz
Copy link
Contributor Author

@ljrirene
yes sorry you will need
Authorization header with your token as the value
you can get your token in local storage after you log in on the app
image

Copy link

@ljrirene ljrirene left a comment

Choose a reason for hiding this comment

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

Well done KaiKane! This function works as expected on my side.

Screen.Recording.2023-12-08.at.12.06.32.mov

Copy link

@Alforoan Alforoan left a comment

Choose a reason for hiding this comment

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

Everything works as intended. Nice!

pr.review.630.mp4

@tdkent tdkent merged commit 3003610 into development Jan 6, 2024
3 checks 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.

4 participants