London |26-JUL - SDC | Ping Wang |Sprint 3| middleware exercises CYF -1165 - #117
Open
pathywang wants to merge 2 commits into
Open
London |26-JUL - SDC | Ping Wang |Sprint 3| middleware exercises CYF -1165#117pathywang wants to merge 2 commits into
pathywang wants to merge 2 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Khantdotcom
approved these changes
Sep 4, 2026
Comment on lines
+33
to
+47
| if (req.username) { | ||
| res.send( | ||
| `You are authenticated as ${req.username}.\n\n` + | ||
| `You have requested information about ${subjects.length} ` + | ||
| `${subjects.length === 1 ? "subject" : "subjects"}` + | ||
| `${subjects.length > 0 ? ": " + subjects.join(", ") : ""}.` | ||
| ); | ||
| } else { | ||
| res.send( | ||
| `You are not authenticated.\n\n` + | ||
| `You have requested information about ${subjects.length} ` + | ||
| `${subjects.length === 1 ? "subject" : "subjects"}` + | ||
| `${subjects.length > 0 ? ": " + subjects.join(", ") : ""}.` | ||
| ); | ||
| } |
There was a problem hiding this comment.
Not an error but I would like to suggest a better approach.
What is the output difference between if and else statements. Read those articles.
Hope you find a "clean code" way!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Self checklist
Task code
CYF -1165
Changelist
Did prep which took long time then made branch under parent directory and complete assignment with test