-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
There was a problem hiding this comment.
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
src/api/userChallenge/controller.ts
Outdated
@@ -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; |
There was a problem hiding this comment.
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
I have fixed all the errors. @vmkhitaryanscn Please take a look at the changes |
Added userChallenge pagination