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

Added userChallenge pagination #33

Merged
merged 10 commits into from
Dec 8, 2024
Merged

Conversation

vmkhitaryanscn
Copy link
Collaborator

Added userChallenge pagination

Copy link
Owner

Choose a reason for hiding this comment

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

We should to mark each challenge according our new statuses and the startAtDate property.

If startAtDate === currentMonth -> ACTIVE
if startAtDate < currentMonth -> COMPLETED

@@ -110,16 +111,30 @@ route.get('/', async (req: Request, res: Response, next: NextFunction) => {
return next(new UnauthorizedError(ErrorMessages.unauthorized));
}

const status = req.query.status as ChallengeStatus;
Copy link
Owner

Choose a reason for hiding this comment

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

I have added the validation lorgic here.

We always should work with safe/parsed values because we don`t know what we can get

@moiskillnadne
Copy link
Owner

I have fixed all the errors. @vmkhitaryanscn Please take a look at the changes

@moiskillnadne moiskillnadne merged commit 2d57ea8 into dev Dec 8, 2024
1 check passed
@moiskillnadne moiskillnadne deleted the feat/userChallenge-pagination branch December 8, 2024 09:05
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.

2 participants