-
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
Rhea create newLessom routes and controller #613
Conversation
Backend Release to Main [0.74]
Backend Release to Main [0.75]
Backend Release to Main [0.76]
Backend Release to Main [0.77]
Backend Release to Main [0.78]
Revert "Backend Release to Main [0.78]"
…-development Revert "Revert "Backend Release to Main [0.78]""
Backend Release to Main [0.79]
Backend Release to Main [0.80]
Backend Release to Main [0.81]
Backend Release to Main [0.82]
Backend Release to Main [0.83]
Backend Release to Main [0.84]
Backend Release to Main [0.85]
Backend Release to Main [0.86]
Backend Release to Main [0.87]
Revert "Backend Release to Main [0.87]"
Backend Release to Main [0.88]
Backend Release to Main [0.89]
Backend Release to Main [0.90]
Backend Release to Main [0.91]
Backend Release to Main [0.92]
Backend Release to Main [0.93]
Backend Release to Main [0.94]
Revert "Backend Release to Main [0.94]"
Backend Release to Main [0.95]
Backend Release to Main [1.19]
Backend Release to Main [1.20]
Backend Release to Main [1.21]
Backend Release to Main [1.22]
Backend Release to Main [1.23]
Revert "Backend Release to Main [1.23]"
Backend Release to Main [1.24]
Backend Release to Main [1.25]
Backend Release to Main [1.26]
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.
Please fix the merge conflicts so this branch can be tested.
Backend Release to Main [1.27]
Backend Release to Main [1.28]
…orking expect empty TAG array
}; | ||
const bmPostLessonList = async (req, res) => { | ||
try { | ||
const { id, title, content, author, tag, relatedProject} = req.body; |
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.
- You don't need to deconstruct
req.body
if you are not using the variables. Line 17 can either be omitted or used to define a new variable such asconst newDoc = req.body; const newLesson = BuildingNewLesson.create(newDoc);
tags
is not updating because Mongo ignores fields that don't exactly match the model. Make sure to renametag
totags
.
try { | ||
const { id, title, content, author, tag, relatedProject} = req.body; | ||
const newLesson = BuildingNewLesson.create(req.body); | ||
newLesson.save().then(result => res.status(200).send(result)) |
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.
- status should be changed to 201, which indicates a new resource was created.
.github/pull_request_template.md
Outdated
@@ -17,10 +17,9 @@ To test this backend PR you need to checkout the #XXX frontend PR. | |||
## How to test: |
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.
- did you mean to revert this file to an older version? Make sure to change it back to its current version if not.
- you can use Source Control in VS Code or
git status
to check which files have been updated before committing. Changes you're not expecting or that are not relevant to your branch can be discarded.
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.
I'm about to ask you about that, because when I use git status
, it showed up that file which I don't even know what that, and I only added my controller file when I did git add <controller name>
.
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.
If you see files that you did not update after using git status
I would just discard those changes. Source Control in VSC makes that really easy if you have it set up.
For now, I would just copy/paste the code for this file from the dev branch and make another commit.
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.
The changes look great, well done!
This PR is about creating routes and controller for newLesson feature from Phase II, including GET and POST request (with local dummy data)
Or Implements # (phase 2 WBS) 6.3.2
Related PRS (if any):
n/a
Main changes explained:
Add bmNewLesson routes and controller
Note:
This is only interacting with local built-in dummy data, please feel free to test on Postman for GET/POST, will update code with mongoose once schema and db set up