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

[Backend] Limiting the Number of upvotes/downvotes a particular user can do Fixed #942

Merged
merged 7 commits into from
May 22, 2024

Conversation

Hemu21
Copy link
Contributor

@Hemu21 Hemu21 commented May 21, 2024

Issue that this pull request solves

Issue Link resolve #919
Closes: #919

Brief description of what is fixed or changed

As the Q&A section is open, users can do the upvote and downvotes any umber of times. Now tey can vote only once.

Types of changes

Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (Documentation content changed)
  • Other (please describe):

Checklist

Put an x in the boxes that apply

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • My changes does not break the current system and it passes all the current test cases.

@auto-assign auto-assign bot requested a review from Kajol-Kumari May 21, 2024 09:28
@@ -24,6 +25,9 @@
// Response time
app.use(responseTime({ suffix: false }));

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

@Kajol-Kumari Kajol-Kumari left a comment

Choose a reason for hiding this comment

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

@Hemu21 did u test this change?

return next(error);
}

res.cookie(getVoteCookieName('question', questionId), true, { maxAge: 20 * 365 * 24 * 60 * 60 * 1000 });
Copy link
Member

Choose a reason for hiding this comment

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

what is the unit of this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kept it to 20 years. why because no one can use a mobile for 20 years.

@Hemu21
Copy link
Contributor Author

Hemu21 commented May 22, 2024

@Kajol-Kumari I had tested Everything works fine. can you please check and merge it. see this

Untitled.video.-.Made.with.Clipchamp.mp4

Copy link
Member

@Kajol-Kumari Kajol-Kumari left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@Kajol-Kumari Kajol-Kumari added level3 New features, major bug fixing. gssoc GSSoC'24 Label labels May 22, 2024
@Kajol-Kumari Kajol-Kumari merged commit 03ab618 into HITK-TECH-Community:main May 22, 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 level3 New features, major bug fixing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Backend] Limiting the Number of upvotes/downvotes a particular user can do
2 participants