-
Notifications
You must be signed in to change notification settings - Fork 1
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
hector upload code example for review, function alter at /:exerciseId… #3
base: main
Are you sure you want to change the base?
Conversation
…/submissions/:submissionId/run
routes/exercises.js
Outdated
req.general_wraper = async (req, res, fn, error_callback) => { | ||
//if this coding style got Accepted, it should be put at middleware, put it here for coding exmaple | ||
// | ||
req.user.id = (await prisma.user.findUnique({ where: { firebaseId: req.user.uid } })).id; |
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.
Think this should be good, non-authenticated view shouldn't be a priority right now so this should be helpful
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 going to move it to the app.js, and add a cache for it, building this for structure use in near future, I going to put authorization everywhere i touched
routes/exercises.js
Outdated
include: { | ||
files: true | ||
//I going to wrap the "try catch" to an general function for future debug and logging demand | ||
req.general_wraper = async (req, res, fn, error_callback) => { |
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.
Typo in wrapper though
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.
corrected, and changed to camel case
Good start, but a few things:
|
1: snake case -> camel case changed |
…ernal use ID to cache and put it in app.js
|
A few more issues to review |
now the code is a little merge together, and I properly need those function in the future work, how about merge it this time, I going to follow the one ticket one function one PR next time? |
…/submissions/:submissionId/run