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

node-week3/Niloufar #225

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

node-week3/Niloufar #225

wants to merge 4 commits into from

Conversation

Niloufar97
Copy link

@Niloufar97 Niloufar97 commented Mar 5, 2024

sql.injection.mp4

@github-actions github-actions bot changed the title Node week3/niloufar node-week3/Niloufar Mar 5, 2024
Copy link

@MahmoudYounes MahmoudYounes left a comment

Choose a reason for hiding this comment

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

Overall, very nice job! thanks a lot!

}
}

console.log("SQL", query.toSQL().sql);

Choose a reason for hiding this comment

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

🤩 debug statement!! Thank you!!.. normally when we are done debugging we remove them in order not to pollute the server output


if ("sort" in req.query) {
const orderBy = req.query.sort.toString();
if (orderBy === "first_name"){

Choose a reason for hiding this comment

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

the input query parameter will be first_name%20ASC, meaning sort by first name ascending. so orderby check here would be
if (orderBy === "first_name ASC"){ //... }

the same for orderBy last name.

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