Skip to content

Feat: Added a count for papers in the searchbar-child.tsx #226

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

Merged
merged 1 commit into from
Jul 30, 2025

Conversation

koolaid06
Copy link
Contributor

No description provided.

Copy link
Collaborator

@abhitrueprogrammer abhitrueprogrammer left a comment

Choose a reason for hiding this comment

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

overall nice first PR

const cleanSubject = subjectName.replace(/^"|"$/g, "");
const encodedSubject = encodeURIComponent(cleanSubject);

const response = await axios.get(`/api/papers/count?subject=${encodedSubject}`);
Copy link
Collaborator

@abhitrueprogrammer abhitrueprogrammer Jul 21, 2025

Choose a reason for hiding this comment

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

  1. Put in the interface of your response like:

axios.get<{count:int}(/api/papers/count?subject=${encodedSubject});

  1. put in the server uri like this: const { data } = await axios.get<ICourses[]>(${process.env.SERVER_URL}/api/course-list);

  2. install eslint plugin and ensure no errors remain. Also do pnpm build and if any errors come up, fix them

Comment on lines 132 to +134
>
{suggestion}
<div id="paper_count" className="bg-[#171720] w-10 h-10 flex items-center justify-center rounded-md text-white text-sm font-semibold mr-4">{subjectCounts[suggestion] ?? "0"}</div>
<span id="subject" className="text-white items-center text-sm sm:text-base tracking-wide">{suggestion}</span>
Copy link
Collaborator

Choose a reason for hiding this comment

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

do add images while making pull requests. Makes it easier to review frontend

@abhitrueprogrammer abhitrueprogrammer merged commit 4033edf into CodeChefVIT:staging Jul 30, 2025
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