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

Remove unverified role from discord on /verify #2156

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f8fd064
Fix username character limit (#2113) (#2115)
vinit717 Aug 30, 2024
0d51a6d
Merge pull request #2120 from Real-Dev-Squad/develop
iamitprakash Sep 1, 2024
5a7f583
Merge pull request #2121 from Real-Dev-Squad/develop
iamitprakash Sep 9, 2024
a2876c0
remove unverified role on /verify
shobhan-sundar-goutam Sep 14, 2024
a8358bf
fix: username generation for new user and modify format format func f…
vinit717 Sep 15, 2024
d4d40b1
[Feat] Extends Toggle privilege feature allowing other roles to be To…
shubhdevelop Sep 15, 2024
1c3a1a6
Revert "Mavens getting listed in idle,idle7d+ (#2127)" (#2158)
vinit717 Sep 16, 2024
0c3153b
Put the toggle feature behind the dev feature flag (#2161)
shubhdevelop Sep 16, 2024
20e40e5
Merge branch 'main' into develop
iamitprakash Sep 16, 2024
5259304
Merge pull request #2157 from Real-Dev-Squad/develop
iamitprakash Sep 16, 2024
524bc4c
chore: fix users firstname and lastname in lower case (#2162)
vinit717 Sep 17, 2024
54cb4bc
Merge pull request #2164 from Real-Dev-Squad/develop
iamitprakash Sep 17, 2024
02b2e9b
Revert "Dev to Main Sync"
vinit717 Sep 17, 2024
4997d90
Merge pull request #2165 from Real-Dev-Squad/revert-2164-develop
iamitprakash Sep 17, 2024
ac2eb4b
Revert "Dev to Main Sync" (#2166)
iamitprakash Sep 17, 2024
29a0d0b
Make firstname and lastname to lowercase (#2168)
vinit717 Sep 17, 2024
14ca890
Merge branch 'main' into develop
iamitprakash Sep 17, 2024
0244dcd
Merge pull request #2169 from Real-Dev-Squad/develop
iamitprakash Sep 17, 2024
0d6d058
Adding FF to Maven getting listed in idle,idle-7d+ (#2171)
fakhruddinkw Sep 20, 2024
7066ff7
Merge branch 'main' into develop
iamitprakash Sep 21, 2024
59d4720
Merge pull request #2172 from Real-Dev-Squad/develop
iamitprakash Sep 21, 2024
e789945
chore: remove feature flag for POST /extension-requests API (#2150)
samarpan1738 Sep 21, 2024
9af8127
chore: remove feature flag for /discord-actions/nicknames/sync API (#…
samarpan1738 Sep 21, 2024
63e945c
Remove dev feature flag for GET /logs API (#2149)
samarpan1738 Sep 21, 2024
edadf41
Remove dev feature flag for GET /requests API (#2151)
samarpan1738 Sep 21, 2024
a6814b6
Remove dev feature flag for POST /requests and PUT /requests/:id APIs…
samarpan1738 Sep 21, 2024
a19b0b3
chore: remove feature flag for GET /extension-requests/self API (#2152)
samarpan1738 Sep 22, 2024
4443293
Merge branch 'main' into develop
iamitprakash Sep 23, 2024
3bf6f1b
Added pagination in profile diffs API
lakshayman Sep 22, 2024
6970bff
Tests added
lakshayman Sep 23, 2024
3b68c3e
Return empty data if no userId found
lakshayman Sep 23, 2024
3c183c2
Comments removed
lakshayman Sep 23, 2024
2251597
Behind feature flag
lakshayman Sep 23, 2024
349df01
Next link should have feature flag
lakshayman Sep 23, 2024
eeafaaa
enhancement: adding filtered applications count (#2178)
rishirishhh Sep 25, 2024
7be7be2
Merge branch 'develop' into feat/paginationInProfileDiffsAPI
lakshayman Sep 28, 2024
29122bb
Merge pull request #2179 from Real-Dev-Squad/feat/paginationInProfile…
lakshayman Sep 28, 2024
41c136d
fix: Replace the deprecated function for sending notification (#2185)
divyansh0908 Sep 28, 2024
b7f61c7
remove unverified role on /verify
shobhan-sundar-goutam Sep 14, 2024
7522435
modified code and added tests
shobhan-sundar-goutam Oct 1, 2024
65e3f65
Merge branch 'update-/verify-functionality' of https://github.com/sho…
shobhan-sundar-goutam Oct 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions constants/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ const discordNicknameLength = 32;

const SIMULTANEOUS_WORKER_CALLS = 4;

const MAX_USERNAME_LENGTH = 32;

module.exports = {
profileStatus,
USER_STATUS,
Expand All @@ -61,4 +63,5 @@ module.exports = {
months,
discordNicknameLength,
SIMULTANEOUS_WORKER_CALLS,
MAX_USERNAME_LENGTH,
};
18 changes: 14 additions & 4 deletions controllers/applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ const admin = require("firebase-admin");

const getAllOrUserApplication = async (req: CustomRequest, res: CustomResponse): Promise<any> => {
try {
const { userId, status, next, size } = req.query;
const { userId, status, next, size, dev } = req.query;
const limit = Number(size) || 25;
let nextPageUrl = null;
const isDevMode = dev === "true";

if (userId) {
const applications = await ApplicationModel.getUserApplications(userId);
Expand All @@ -23,17 +24,26 @@ const getAllOrUserApplication = async (req: CustomRequest, res: CustomResponse):
}

if (status) {
const { applications, lastDocId } = await ApplicationModel.getApplicationsBasedOnStatus(status, limit, next);
const { applications, lastDocId, totalCount } = await ApplicationModel.getApplicationsBasedOnStatus(
status,
limit,
next
);

if (applications.length === limit) {
nextPageUrl = `/applications?next=${lastDocId}&size=${limit}&status=${status}`;
}

return res.json({
const response = {
message: API_RESPONSE_MESSAGES.APPLICATION_RETURN_SUCCESS,
applications,
next: nextPageUrl,
});
};
if (isDevMode) {
response["totalCount"] = totalCount;
}

return res.json(response);
}

const { applications, lastDocId } = await ApplicationModel.getAllApplications(limit, next);
Expand Down
13 changes: 4 additions & 9 deletions controllers/discordactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ const updateDiscordImageForVerification = async (req, res) => {
*/
const setRoleIdleToIdleUsers = async (req, res) => {
try {
const result = await discordRolesModel.updateIdleUsersOnDiscord();
const { dev } = req.query;
const result = await discordRolesModel.updateIdleUsersOnDiscord(dev);
return res.status(201).json({
message: "All Idle Users updated successfully.",
...result,
Expand All @@ -231,7 +232,8 @@ const setRoleIdleToIdleUsers = async (req, res) => {
*/
const setRoleIdle7DToIdleUsers = async (req, res) => {
try {
const result = await discordRolesModel.updateIdle7dUsersOnDiscord();
const { dev } = req.query;
const result = await discordRolesModel.updateIdle7dUsersOnDiscord(dev);
return res.status(201).json({
message: "All Idle 7d+ Users updated successfully.",
...result,
Expand All @@ -251,13 +253,6 @@ const setRoleIdle7DToIdleUsers = async (req, res) => {

const updateDiscordNicknames = async (req, res) => {
try {
const { dev } = req.query;
if (dev !== "true") {
return res.status(404).json({
message: "Users Nicknames not updated",
});
}

const membersInDiscord = await getDiscordMembers();
const usersInDB = await fetchAllUsers();
const usersToBeEffected = [];
Expand Down
Loading