aadeshkulkarni / figuringout

Blogging + Social Media + AI | Opensource | Javascript | ReactJS | HonoJS | Prisma
https://figuringout.life
MIT License
89 stars 91 forks source link

Bug | Topics with 0 posts #241

Open aadeshkulkarni opened 1 month ago

aadeshkulkarni commented 1 month ago

Current:

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

Expectation:

Note:

AbdulWahab3181 commented 1 month ago

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?

0xprathamesh commented 1 month ago

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.

aadeshkulkarni commented 1 month ago

@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 commented 1 month ago

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.

vverma022 commented 1 month ago

Could I work on this

aadeshkulkarni commented 1 month ago

Sure

vverma022 commented 1 month ago

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

vverma022 commented 1 month ago

@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.

aadeshkulkarni commented 1 month ago
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

vverma022 commented 1 month ago
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 commented 1 month ago

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.