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

Fixes #152 #171

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sarkartanmay393
Copy link
Contributor

I removed all topics from /client/src/data/topics.ts, and created a function to load all topics data from the backend database. I called this URL /api/get-topics and got all topics data, then returned that data from my function. And Finally, switch the source of all by tweaking a little.

@Lalit3716 It is working fine on my machine, kindly review it.

@github-actions
Copy link

github-actions bot commented Mar 7, 2023

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

@sarkartanmay393
Copy link
Contributor Author

@Lalit3716 Check this out Lalit.

Copy link
Collaborator

@Lalit3716 Lalit3716 left a comment

Choose a reason for hiding this comment

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

Great work on this @sarkartanmay393, please address the change I have mentioned, Thanks!

export const topics = topicsData.sort((a, b) => a.value - b.value);

export const shuffleTopics = shuffleArray(topicsData);
export const shuffleTopics = shuffleArray(await getTopics());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't use top-level awaits because it may not be supported in some old browsers and hence the checks on this PR are failing.
Try to come up with something that does not involve top-level awaits.

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