feat: Order articles by updated_at (#6324)

* feat: Order articles by updated_at

* Sort before pagination

---------

Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
This commit is contained in:
Shubham Kumar
2023-01-31 17:28:14 +05:30
committed by GitHub
parent ee3124cf84
commit 4d92cafd3f
2 changed files with 2 additions and 1 deletions

View File

@@ -8,7 +8,7 @@ class Api::V1::Accounts::ArticlesController < Api::V1::Accounts::BaseController
@portal_articles = @portal.articles
@all_articles = @portal_articles.search(list_params)
@articles_count = @all_articles.count
@articles = @all_articles.page(@current_page)
@articles = @all_articles.order_by_updated_at.page(@current_page)
end
def create