FEATURE: Add after query param topic filter (PR #14466)

This will allow you to pass in the after option to filter topics by certain days. The before option flag already exists.



or along with before


Here is a list of topics without a filter, but if we add the the /latest?before=3&after=10 filter it will include what is in the blue box:

with the filter applied:


We can store the results of the query in a variable here so we don’t query the database for something we already have.

Are we able to use fab! instead?

Will the Ember app be using the after param just like the before param? If this is meant for a plugin, it’ll be better for the plugin to add support for this instead of having core carry this.

    if (after = options[:after].to_i) && after > 0
      result = result.where('topics.created_at > ?', after.days.ago)

Thanks for the feedback :slight_smile:

Going to close this though and will probably go a plugin route since there are many more additions I need to make.