figuringout icon indicating copy to clipboard operation
figuringout copied to clipboard

Bug | Topics with 0 posts

Open aadeshkulkarni opened this issue 1 year ago • 11 comments

Current:

All topics are displayed at the top. Even topics with 0 posts.

Expectation:

  • Show only those topics which have at least 1 post.
  • Sort topics by count(posts)

Note:

  • Implement this in the backend

aadeshkulkarni avatar Jul 10 '24 09:07 aadeshkulkarni

Hi @aadeshkulkarni ! I would like to work on this. Could you please explain a little more as I am new here? Also, could you please tell me if there is a bounty? If yes, what's the amount and what is the process?

AbdulWahab3181 avatar Jul 10 '24 16:07 AbdulWahab3181

Hi @aadeshkulkarni , I would like to work on the enhancement to display only those topics which have at least 1 post and to sort topics by the count of posts. Could you please assign this task to me? and i would also like to add a Saved Posts page so that the user can see his saved post.

0xprathamesh avatar Jul 11 '24 01:07 0xprathamesh

@AbdulWahab3181 -

Could you please explain a little more as I am new here?

This bug is on / and /blogs route. Specifically, the Topics slider that is displayed beneath the header. Please take the app for a spin. And also, set the codebase locally. This should definitely help you understand the issue better.

Also, could you please tell me if there is a bounty? If yes, what's the amount and what is the process?

No bounty for this one. Sorry.

PS: Please read the CONTRIBUTING.md file for contribution guidelines. Whenever you'd like to work on any issue, please make sure you mention your approach as well.

aadeshkulkarni avatar Jul 11 '24 14:07 aadeshkulkarni

Hi @aadeshkulkarni , I would like to work on the enhancement to display only those topics which have at least 1 post and to sort topics by the count of posts. Could you please assign this task to me? and i would also like to add a Saved Posts page so that the user can see his saved post.

Assigning this issue to you. Saved post page is not required. We already have a bookmarks page that achieves this.

aadeshkulkarni avatar Jul 11 '24 14:07 aadeshkulkarni

Could I work on this

vverma022 avatar Jul 14 '24 04:07 vverma022

Sure

aadeshkulkarni avatar Jul 15 '24 17:07 aadeshkulkarni

Thank you I'll create an approach to the problem and post my solution after looking at the codebase.

vverma022 avatar Jul 15 '24 17:07 vverma022

@aadeshkulkarni will filtering the blogs in the prisma query a right approach to the bug. I could modify the tagRouter.get("/", async (c) => { try { const prisma = getDBInstance(c);

	let query: any = {
		select: {
			id: true,
			tagName: true,
		},
	};. 

Are there any other backend end-points I need to take into consideration.

vverma022 avatar Jul 16 '24 15:07 vverma022

Screenshot 2024-07-24 at 10 11 58 AM

@vverma022 - Your code breaks. Did you not verify your code by running it locally ?

Reverting your changes so that app is functional

aadeshkulkarni avatar Jul 24 '24 04:07 aadeshkulkarni

Screenshot 2024-07-24 at 10 11 58 AM

@vverma022 - Your code breaks. Did you not verify your code by running it locally ?

Reverting your changes so that app is functional

Apologies for the oversight. I might have some issues in my backend setup. Looking into them a creating a pull request with valid changes and appropriate screen shots.

vverma022 avatar Jul 24 '24 07:07 vverma022

While filtering the tag router a bug is that even while publishing a blog when selecting a tag the other do not show-up. So in the Tags.tsx component a filter will be needed.

vverma022 avatar Jul 27 '24 15:07 vverma022