Skip to content

added endpoint for generating and getting discord invite for user#1553

Merged
prakashchoudhary07 merged 23 commits intodevelopfrom
discord-invite-api
Dec 4, 2023
Merged

added endpoint for generating and getting discord invite for user#1553
prakashchoudhary07 merged 23 commits intodevelopfrom
discord-invite-api

Conversation

@vinayak-trivedi
Copy link
Copy Markdown
Contributor

@vinayak-trivedi vinayak-trivedi commented Sep 24, 2023

closes #1631

Backend changes

  • Yes
  • No

Frontend Changes

  • Yes
  • No

Is Under Feature Flag

  • Yes
  • No

Database changes

  • Yes
  • No

Breaking changes (If your feature is breaking/missing something please mention pending tickets)

  • Yes
  • No

Tested in staging

  • Yes
  • No

Controllers file
image

checkCanGenerateDiscordLink middleware
image

model file
image

**Api contract: **https://github.com/Real-Dev-Squad/website-api-contracts/pull/157/files?short_path=081a121#diff-081a121ca09a9dacb560d4ae94cada3b27a681f8cde30c68b5f307abb87930da
**Data model docs: ** RealDevSquad/website-data-models#60

@vinayak-trivedi vinayak-trivedi self-assigned this Sep 24, 2023
@vinayak-trivedi vinayak-trivedi marked this pull request as draft September 24, 2023 05:33
Comment thread routes/discordactions.js
router.post("/groups", authenticate, checkIsVerifiedDiscord, validateGroupRoleBody, createGroupRole);
router.get("/groups", authenticate, checkIsVerifiedDiscord, getAllGroupRoles);
router.post("/roles", authenticate, checkIsVerifiedDiscord, validateMemberRoleBody, addGroupRoleToMember);
router.get("/invite", authenticate, getUserDiscordInvite);

Check failure

Code scanning / CodeQL

Missing rate limiting

This route handler performs [authorization](1), but is not rate-limited. This route handler performs [authorization](2), but is not rate-limited. This route handler performs [authorization](3), but is not rate-limited.
Comment thread routes/discordactions.js
router.get("/groups", authenticate, checkIsVerifiedDiscord, getAllGroupRoles);
router.post("/roles", authenticate, checkIsVerifiedDiscord, validateMemberRoleBody, addGroupRoleToMember);
router.get("/invite", authenticate, getUserDiscordInvite);
router.post("/invite", authenticate, checkCanGenerateDiscordLink, generateInviteForUser);

Check failure

Code scanning / CodeQL

Missing rate limiting

This route handler performs [authorization](1), but is not rate-limited. This route handler performs [authorization](2), but is not rate-limited. This route handler performs [authorization](3), but is not rate-limited.
@vinayak-trivedi vinayak-trivedi marked this pull request as ready for review October 27, 2023 16:18
@vinayak-trivedi vinayak-trivedi changed the title [wip] added enpoint for generating and getting discord invite for user added enpoint for generating and getting discord invite for user Oct 27, 2023
@vinit717
Copy link
Copy Markdown
Member

Tests are failing
and please add tests stats

Copy link
Copy Markdown
Contributor

@satyam73 satyam73 left a comment

Choose a reason for hiding this comment

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

Please also write validators for the request data

Comment thread controllers/discordactions.js
Comment thread types/global.d.ts Outdated
Comment thread types/global.d.ts Outdated
Comment thread types/global.d.ts Outdated
Comment thread types/global.d.ts Outdated
@satyam73
Copy link
Copy Markdown
Contributor

Tests are failing, please have a look

Comment thread controllers/discordactions.js
Comment thread models/discordactions.js Outdated
Comment thread types/global.d.ts Outdated
Comment thread types/global.d.ts
Comment thread controllers/discordactions.js Outdated
Comment thread test/integration/discordactions.test.js Outdated
Comment thread test/integration/discordactions.test.js
@heyrandhir
Copy link
Copy Markdown
Contributor

Generally Tejas recommends to follow the standard template like Backend changes,Frontend Changes,Is Under Feature , Database changes etc in the ticket. It would be great if you can update these apart from coverage.

Comment thread test/integration/discordactions.test.js Outdated
Comment thread test/integration/discordactions.test.js Outdated
@satyam73
Copy link
Copy Markdown
Contributor

Test are failing please have a look

Comment thread test/integration/discordactions.test.js Outdated
@vinayak-trivedi vinayak-trivedi changed the title added enpoint for generating and getting discord invite for user added endpoint for generating and getting discord invite for user Nov 1, 2023
heyrandhir
heyrandhir previously approved these changes Nov 2, 2023
Comment thread test/integration/discordactions.test.js Outdated
Co-authored-by: Satyam Bajpai <bajpai1973satyam@gmail.com>
satyam73
satyam73 previously approved these changes Nov 2, 2023
Copy link
Copy Markdown
Contributor

@satyam73 satyam73 left a comment

Choose a reason for hiding this comment

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

LGTM

heyrandhir
heyrandhir previously approved these changes Nov 2, 2023
@vinayak-trivedi vinayak-trivedi dismissed stale reviews from heyrandhir and satyam73 via c8e52fb November 9, 2023 15:28
satyam73
satyam73 previously approved these changes Nov 9, 2023
heyrandhir
heyrandhir previously approved these changes Nov 10, 2023
Comment thread controllers/discordactions.js Outdated
Comment thread controllers/discordactions.js
Comment thread controllers/discordactions.js Outdated
Comment thread models/discordactions.js
Comment thread test/unit/models/discordactions.test.js
Comment thread test/unit/models/discordactions.test.js Outdated
Comment thread types/global.d.ts Outdated
@vinayak-trivedi vinayak-trivedi dismissed stale reviews from heyrandhir and satyam73 via 9f2870c November 18, 2023 15:36
Comment thread config/development.js
@prakashchoudhary07 prakashchoudhary07 merged commit 824ecf1 into develop Dec 4, 2023
@prakashchoudhary07 prakashchoudhary07 deleted the discord-invite-api branch December 4, 2023 21:21
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.

create endpoints for generating a discord invite for user and fetching it

6 participants