Skip to content

Conversation

@alan-w25
Copy link
Collaborator

Submisson.js in routes folder now.

@longtran1904
Copy link
Collaborator

Hi Alan, can you edit the file like this example
https://github.com/hagopj13/node-express-boilerplate/blob/master/src/routes/v1/user.route.js

Specifically, just leave the router without any content inside the brackets

Copy link
Collaborator

@longtran1904 longtran1904 left a comment

Choose a reason for hiding this comment

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

Hi Alan, please check out the comments

* tags:
* - submissions
*/
router.get('/', async ({ res }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

In Router folder, we just specify the route we want to export, for example
router
.route('/:userId')
.get(userController.getUser);

So you can drop the async promises and left it blank.
Do the rest for the other functions and it would be fine.

* tags:
* - submissions
*/
router.get('/:submissionID', async (req, res) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

For example,
You can just leave the code:
router.get('/:submissionId', /* call function to get submissionID here */

@longtran1904 longtran1904 merged commit 38ca055 into HackRU:SubmissionRouter Jan 27, 2023
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.

2 participants