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

NodeJS Controllers: Update lesson to flow with the previous lesson #28665

Merged

Conversation

fcasibu
Copy link
Contributor

@fcasibu fcasibu commented Aug 19, 2024

Because

Doesn't flow well enough with the previous lesson and includes passive tone in writing.

This PR

  • Make the lesson flow with the routes lesson, to use author example.
  • At the very least improve the tone (not that good of an english speaker 😢 so not confident with this but will try to do another re-read)

Issue

Closes #28530

Additional Information

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project curriculum contributing guide
  • The title of this PR follows the location of change: brief description of change format, e.g. Intro to HTML and CSS lesson: Fix link text
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
  • If any lesson files are included in this PR, they follow the Layout Style Guide

@github-actions github-actions bot added the Content: NodeJS Involves the NodeJS course label Aug 19, 2024
@fcasibu fcasibu force-pushed the rework-nodejs-controller-lesson branch 6 times, most recently from 96ca621 to a2c2940 Compare August 19, 2024 22:58
@MaoShizhong MaoShizhong self-requested a review August 20, 2024 00:03
Copy link
Contributor

@MaoShizhong MaoShizhong left a comment

Choose a reason for hiding this comment

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

Many thanks for working through the feedback!

Some initial comments - I haven't had the time to look at the error handling section and beyond, so I'll get to those in due course (as well as the Routes lesson changes I mentioned).

nodeJS/express/controllers.md Outdated Show resolved Hide resolved
nodeJS/express/controllers.md Outdated Show resolved Hide resolved
nodeJS/express/controllers.md Outdated Show resolved Hide resolved
nodeJS/express/controllers.md Outdated Show resolved Hide resolved
nodeJS/express/controllers.md Outdated Show resolved Hide resolved
nodeJS/express/controllers.md Outdated Show resolved Hide resolved
nodeJS/express/controllers.md Outdated Show resolved Hide resolved
nodeJS/express/controllers.md Outdated Show resolved Hide resolved
nodeJS/express/controllers.md Outdated Show resolved Hide resolved
nodeJS/express/controllers.md Outdated Show resolved Hide resolved
@fcasibu fcasibu force-pushed the rework-nodejs-controller-lesson branch from c238eee to a895767 Compare September 13, 2024 07:46
Copy link
Contributor

@MaoShizhong MaoShizhong left a comment

Choose a reason for hiding this comment

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

Whew! Amazing work. Just a few more small things and a small merge conflict due to #28858 but otherwise I'm happy to merge this along with the Routes changes PR when that's also approved.

Comment on lines 139 to 141
const getAuthorById = async (authorId) => {
return authors.find(author => author.id === authorId);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking through the rest of the curriculum, it actually looks like most of the time we use function declarations. Nit but for the sake of consistency, I think the functions in this lesson should be func decs unless they're callbacks defined inline (e.g. asyncHandler callback).

Suggested change
const getAuthorById = async (authorId) => {
return authors.find(author => author.id === authorId);
};
async function getAuthorById(authorId) {
return authors.find(author => author.id === authorId);
};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done with changing most functions

nodeJS/express/controllers.md Outdated Show resolved Hide resolved
nodeJS/express/controllers.md Outdated Show resolved Hide resolved
nodeJS/express/controllers.md Outdated Show resolved Hide resolved
nodeJS/express/controllers.md Outdated Show resolved Hide resolved
nodeJS/express/controllers.md Outdated Show resolved Hide resolved
nodeJS/express/controllers.md Outdated Show resolved Hide resolved
nodeJS/express/controllers.md Outdated Show resolved Hide resolved
@fcasibu fcasibu requested a review from MaoShizhong September 25, 2024 04:55
Copy link
Contributor

@MaoShizhong MaoShizhong left a comment

Choose a reason for hiding this comment

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

Amazing work as always 🙏 Just the one grammar nit but otherwise I'm happy with this and will merge together with #28763 when that's approved.

nodeJS/express/controllers.md Outdated Show resolved Hide resolved
@MaoShizhong MaoShizhong added the Status: Do Not Merge This PR should not be merged until further notice label Sep 25, 2024
@MaoShizhong MaoShizhong removed the Status: Do Not Merge This PR should not be merged until further notice label Oct 13, 2024
@MaoShizhong MaoShizhong merged commit ce7ebd9 into TheOdinProject:main Oct 13, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content: NodeJS Involves the NodeJS course
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Controllers: code instructions are non-committal at times.
3 participants