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

Upvote and Downvotes fixed #1093

Merged
merged 1 commit into from
Jul 31, 2024
Merged

Conversation

BHS-Harish
Copy link
Contributor

Issue that this pull request solves

Closes: #1004

Proposed changes

The followings are added

  • Upvote and downvote added
  • Each user can add only one votes per question.

Types of changes

Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue

Screenshots

image

Other information

Any other information that is important to this pull request

@auto-assign auto-assign bot requested a review from Kajol-Kumari July 30, 2024 17:42
},
])
);
const existingQues=await question.findById(questionId)

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources High

This query object depends on a
user-provided value
.
);
const existingQues=await question.findById(questionId)
if(!existingQues.downvotes){
const [err] = await to(question.updateOne({ _id: questionId },{$set:{downvotes:0}}));

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources High

This query object depends on a
user-provided value
.
if(!existingQues.downvotes){
const [err] = await to(question.updateOne({ _id: questionId },{$set:{downvotes:0}}));
}
const [err] = await to(question.updateOne({ _id: questionId }, { $inc: { downvotes: 1 } }));

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources High

This query object depends on a
user-provided value
.
@@ -15,8 +15,20 @@
// Set security headers
app.use(helmet());

// cookie
app.use(cookieParser());

Check failure

Code scanning / CodeQL

Missing CSRF middleware High

This cookie middleware is serving a
request handler
without CSRF protection.
This cookie middleware is serving a
request handler
without CSRF protection.
This cookie middleware is serving a request handler without CSRF protection.
This cookie middleware is serving a request handler without CSRF protection.
@BHS-Harish
Copy link
Contributor Author

Hey @Kajol-Kumari

Please review it and merge it....

The above failure doesn't affect any functionality

Please upgrade the level from level1 to level2 If possible

Don't forget to add FRONTEND_URL in Backend ENV

@Kajol-Kumari Kajol-Kumari added level2 Bug fixing, adding small features. gssoc GSSoC'24 Label labels Jul 31, 2024
@Kajol-Kumari Kajol-Kumari merged commit dabd60f into HITK-TECH-Community:main Jul 31, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc GSSoC'24 Label level2 Bug fixing, adding small features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Downvote in Q&A bug
2 participants