-
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
Adding comments for personalization demo #69
base: main
Are you sure you want to change the base?
Conversation
res.set('Content-Type', 'application/javascript'); | ||
// Set the Content-Type header to 'application/javascript' |
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.
Why adding the same comment twice?
const currentTheme = req.cookies.theme || 'light'; | ||
// Route to get the current personalization settings |
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.
Why adding the same comment twice?
if (!response.ok) { | ||
throw new Error('Network response was not ok'); | ||
// If the response was not successful, throw an error |
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.
This comment should go one line above, comments are added before the line instead of after the line.
if (!response.ok) { | ||
throw new Error('Network response was not ok'); | ||
// If the response was not successful, throw an error | ||
errorMessages.textContent = `Network response was not ok ${response.status} - ${response.statusText}`; |
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.
This line needs to be changed, after the error is thrown, the subsequent lines are not executed/interpreted.
const { theme } = req.body; | ||
|
||
// Route to get the current personalization settings |
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.
This comment belongs to which line?
Description
This pull request adds comments to the personalization demo code.