Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fellyph
Copy link
Contributor

@fellyph fellyph commented May 2, 2024

Description

This pull request adds comments to the personalization demo code.

@fellyph fellyph requested a review from gagan0123 May 2, 2024 17:27
res.set('Content-Type', 'application/javascript');
// Set the Content-Type header to 'application/javascript'
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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}`;
Copy link
Member

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
Copy link
Member

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?

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