-
Notifications
You must be signed in to change notification settings - Fork 30
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 lessonlist routing/controller #654
Conversation
…a and can now edit and delete lessons. need to tweak edit to only edit certain items. also need to work on like functionality
…tartup/db that i will delete once approved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on implementing the API endpoints. One aspect worth considering is the authorization control for the deletion endpoint. Currently, anyone with access to the endpoint and the lesson ID can delete lesson data.
API testing tool used: Postman
PR review walk through:
https://github.com/OneCommunityGlobal/HGNRest/assets/69735000/d4413fc2-9089-49ad-a2f5-69c551d5bc58
Test scripts:
ModifySingleLessonTest.txt
DeleteSingleLessonTest.txt
GetAllLessonsTest.txt
GetSingleLessonTest.txt
@ChengyanOo
|
… is building manager/admin or the user who made the lesson.
@ChengyanOo |
Will do! I just joined the team so my main task will just be reviewing prs for now, will take a look at your updated code again tomorrow! Best wishes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick explanation of reasons I approved this PR:
- Successful Unit Testing: In my previous review, I ran unit tests for four different RESTful endpoints. The results of these tests were satisfactory and were detailed in my last comment.
- Stability of Codebase: Since the last review, no major changes have been made to the code. This stability ensures that re-running the unit tests is not necessary for this set of changes.
- Authorization Feature for Deletion Endpoint: @Kaikanes has confirmed that the deletion endpoint does not require an authorization check at this stage. Therefore, no additional authorization features need to be implemented currently.
Thank you again for your thorough review. You went the extra mile and even conducted tests, which is awesome! |
Description
Created routing/controllers for lesson list page so users can edit a lesson or delete a lesson in the back end. Can also fetch all lessons and a single lesson.
Related PRS (if any):
Used the same model from
#635
Will eventually be used in the front end which is still in the works
OneCommunityGlobal/HighestGoodNetworkApp#1618
Main changes explained:
How to test:
npm install
and 'npm run dev'Screenshots or videos of changes:
2023-12-20.22-31-13.mp4
GRAB TOKEN IN APP FRONT END LOCAL STORAGE
HEADER (I use insomnia)
Note:
I just hard coded a random user and project for the seed data and will not be merging the seedDatabase function in startup/db. Its just for testing.