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

getter contest APIs #80

Merged
merged 16 commits into from
Dec 19, 2020
Merged

getter contest APIs #80

merged 16 commits into from
Dec 19, 2020

Conversation

ridhishjain-zepto
Copy link
Collaborator

@ridhishjain-zepto ridhishjain-zepto commented Dec 14, 2020

Issue at work: #60

APIs:

  • getContest
    GET /contests/:contest_id
  • getContestDetails
    GET /contests/:contest_id/details
  • getContests
    GET /contests?status=active&limit=5
  • getModeratorContests
    GET /contests/moderator_contests?limit=5
  • getContestModerators
    GET /contests/:contest_id/moderators
  • participate
    POST /contests/:contest_id/participate
  • getAllParticipants
    GET /contests/:contest_id/participants
  • getAllParticipantsDetails
    GET /contests/:contest_id/participants_details

Copy link
Collaborator

@cjchirag7 cjchirag7 left a comment

Choose a reason for hiding this comment

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

Some query optimisations.

server/models/contests/getAllParticipantsDetails.js Outdated Show resolved Hide resolved
server/models/contests/getAllParticipants.js Outdated Show resolved Hide resolved
server/models/contests/getAllParticipants.js Outdated Show resolved Hide resolved
server/models/contests/getContest.js Outdated Show resolved Hide resolved
server/models/contests/getContestModerators.js Outdated Show resolved Hide resolved
server/models/contests/getContests.js Outdated Show resolved Hide resolved
server/models/contests/participate.js Outdated Show resolved Hide resolved
server/models/contests/getAllParticipantsDetails.js Outdated Show resolved Hide resolved
server/models/contests/getContest.js Outdated Show resolved Hide resolved
server/models/contests/getContest.js Outdated Show resolved Hide resolved
server/models/contests/getContests.js Outdated Show resolved Hide resolved
server/models/contests/getContests.js Outdated Show resolved Hide resolved
server/models/contests/getContests.js Outdated Show resolved Hide resolved
server/models/contests/getContests.js Outdated Show resolved Hide resolved
server/models/contests/getModeratorContests.js Outdated Show resolved Hide resolved
server/models/contests/participate.js Outdated Show resolved Hide resolved
server/models/contests/participate.js Outdated Show resolved Hide resolved
server/models/contests/getContests.js Outdated Show resolved Hide resolved
server/models/contests/getContests.js Outdated Show resolved Hide resolved
server/models/contests/getContests.js Outdated Show resolved Hide resolved
@ridhishjain-zepto
Copy link
Collaborator Author

@cjchirag7 @NBNARADHYA other than getContests model....that i have to change, are there any more suggestions or changes in rest part?

Copy link
Collaborator

@cjchirag7 cjchirag7 left a comment

Choose a reason for hiding this comment

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

Some changes are required, as mentioned in below comments.
Apart from those, getContests should also be modified, as discussed earlier, to keep the queries simple and remove the need of sortContests()

server/models/contests/getContestModerators.js Outdated Show resolved Hide resolved
server/models/contests/getModeratorContests.js Outdated Show resolved Hide resolved
server/models/contests/participate.js Outdated Show resolved Hide resolved
server/models/contests/participate.js Outdated Show resolved Hide resolved
@Cyber-Labs Cyber-Labs deleted a comment from NBNARADHYA Dec 19, 2020
@Cyber-Labs Cyber-Labs deleted a comment from NBNARADHYA Dec 19, 2020
@Cyber-Labs Cyber-Labs deleted a comment from NBNARADHYA Dec 19, 2020
@Cyber-Labs Cyber-Labs deleted a comment from NBNARADHYA Dec 19, 2020
@Cyber-Labs Cyber-Labs deleted a comment from NBNARADHYA Dec 19, 2020
@Cyber-Labs Cyber-Labs deleted a comment from NBNARADHYA Dec 19, 2020
@Cyber-Labs Cyber-Labs deleted a comment from NBNARADHYA Dec 19, 2020
@Cyber-Labs Cyber-Labs deleted a comment from NBNARADHYA Dec 19, 2020
@Cyber-Labs Cyber-Labs deleted a comment from NBNARADHYA Dec 19, 2020
@Cyber-Labs Cyber-Labs deleted a comment from NBNARADHYA Dec 19, 2020
@Cyber-Labs Cyber-Labs deleted a comment from NBNARADHYA Dec 19, 2020
@Cyber-Labs Cyber-Labs deleted a comment from NBNARADHYA Dec 19, 2020
@Cyber-Labs Cyber-Labs deleted a comment from NBNARADHYA Dec 19, 2020
Copy link
Collaborator

@cjchirag7 cjchirag7 left a comment

Choose a reason for hiding this comment

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

Just a few changes required

server/models/contests/getContests.js Outdated Show resolved Hide resolved
server/models/contests/getContests.js Outdated Show resolved Hide resolved
server/models/contests/getContests.js Outdated Show resolved Hide resolved
server/models/contests/getModeratorContests.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@cjchirag7 cjchirag7 left a comment

Choose a reason for hiding this comment

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

LGTM!

@cjchirag7
Copy link
Collaborator

@NBNARADHYA , you may also review once.

Copy link
Contributor

@NBNARADHYA NBNARADHYA left a comment

Choose a reason for hiding this comment

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

LGTM !

@cjchirag7 cjchirag7 merged commit 1335688 into Cyber-Labs:master Dec 19, 2020
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.

4 participants