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 backend route for fetching topic data #153

Merged
merged 4 commits into from
Oct 6, 2022

Conversation

Icelain
Copy link
Contributor

@Icelain Icelain commented Oct 3, 2022

Route is: /api/get-topics. Partially improves #152

@github-actions
Copy link

github-actions bot commented Oct 3, 2022

Our team will soon review your PR. Thanks @Icelain :)

@Lalit3716
Copy link
Collaborator

The endpoint looks okay! but I was thinking if you could fetch the topics data from the MongoDB database?

@Lalit3716 Lalit3716 self-requested a review October 4, 2022 10:10
@Icelain
Copy link
Contributor Author

Icelain commented Oct 4, 2022

The endpoint looks okay! but I was thinking if you could fetch the topics data from the MongoDB database?

Oh yeah I was wondering about that. Didn't know earlier but thanks for the confirmation. I'll work on it.

@Icelain
Copy link
Contributor Author

Icelain commented Oct 4, 2022

hey I made the changes. Is it okay?

@Lalit3716 Lalit3716 added the hacktober-fest Hacktober Fest Task label Oct 5, 2022
@Lalit3716
Copy link
Collaborator

Yeah, it looks good but it would be great if you could paginate the response. You can see this controller for reference.

let nextPage: number | null = null;
let prevPage: number | null = null;

const limit = Number(req.query.limit) === 0 ? 15 : Number(req.query.limit);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change default to 0 i.e. no limit

@Icelain
Copy link
Contributor Author

Icelain commented Oct 6, 2022

I made the limit 0 by default :)

@Lalit3716
Copy link
Collaborator

LGTM 🎉

@Lalit3716 Lalit3716 added hacktoberfest-accepted and removed hacktober-fest Hacktober Fest Task labels Oct 6, 2022
@Lalit3716 Lalit3716 merged commit 8be208f into Vita-App:main Oct 6, 2022
@github-actions
Copy link

github-actions bot commented Oct 6, 2022

Thank you @Icelain for taking out your valuable time in order to contribute to our project. Looking forward for more such amazing contributions :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants