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 JSON Server Support in the FAQs and Forums Page | Issue #493 #519

Merged
merged 3 commits into from
Nov 10, 2024

Conversation

Shariq2003
Copy link
Contributor

fix #493

This PR introduces support for fetching FAQs and Posts data from a JSON server, replacing the previous static import of FAQs and Posts data. The changes include:

  • Implemented JSON Server for FAQs and Posts:

    • Set up a local JSON server to provide dynamic FAQs and Posts data.
    • Updated the FAQs and Posts page to fetch FAQs and Posts data from the local server (http://localhost:5000/faqs and http://localhost:5000/posts).
  • FAQs and Posts Page Updates:

    • Refactored the FAQs and Posts component to retrieve and display chapters via the JSON server instead of a static FAQs and Posts import.
    • Implemented search and sorting functionality that filters and sorts FAQs and Posts data fetched from the server.

Changes Made:

  • Set up a mock JSON server with FAQs and Posts data in data.json.
  • Updated FAQs and Posts component to make GET requests to http://localhost:5000/faqs and http://localhost:5000/posts to fetch and display FAQs and Posts.
  • Error handling added for cases where a FAQs and Posts is not found (404).

image
image
image

Related Issue:

Closes #493

How to Test:

  1. Ensure that the JSON server is running by executing the following command:
    npx json-server --watch db.json --port 5000

Checklist

Please confirm the following:

  • My code follows the guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly wherever it was hard to understand.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added things that prove my fix is effective or that my feature works.

Copy link
Contributor

github-actions bot commented Nov 9, 2024

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. 😊

1 similar comment
Copy link
Contributor

github-actions bot commented Nov 9, 2024

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. 😊

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🚀 We’re grateful for your pull request and the effort you put into it!
🔍 A maintainer will review it as soon as possible.
We’ll provide feedback if needed and merge it once approved.
Thanks for being an awesome part of our community! 💪

@rishicds
Copy link
Member

Conflicts fix pls

@Shariq2003
Copy link
Contributor Author

Shariq2003 commented Nov 10, 2024

@rishicds sir, review now

@rishicds rishicds merged commit 44ae8b7 into GDSC-RCCIIT:main Nov 10, 2024
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.

Implement JSON Server for Temporary Data Loading on GDG
2 participants