dailydotdev/daily-api

Remove read articles from the main feed

idoshamun opened this issue · 3 comments

As stated in dailydotdev/daily#142, we would like to filter out the read articles from the main feed of the extension.
The first step is to add a filter that will do exactly this in the generateFeed function (https://github.com/dailydotdev/daily-api/blob/master/src/models/post.js#L261). This function is the core that generates all the feeds we can browse. The good news is that a field which indicates whether the post has been read already exists and is called read (obviously :P), now we just need to filter by it.
In the second step, we have to add a parameter to the graphql query which states whether the user would like to filter out the read articles or not (https://github.com/dailydotdev/daily-api/blob/master/src/graphql/schema/post.js#L93).
Lastly, we need to add the user preference so we can sync it across the devices (https://github.com/dailydotdev/daily-api/blob/master/src/models/settings.js). Please make sure to create a knex migration file.
It is highly important to add tests to check everything, this is a core functionality of the API and we have to make sure it works and will keep working on every change.
I would love to provide more information if needed :)

Okay, @idoshamun I'll go through the instructions mentioned above and will let you know if any help is needed.

Thank you :)

Hey, @idoshamun I have opened a draft PR #47 where I'll be pushing the changes, can you please review the changes so that I know I am moving in the right direction.