Skip to content

Commit

Permalink
Allow articles to be sorted by "created" date.
Browse files Browse the repository at this point in the history
Adding a new sort option to the `TeamType.articles` field: "created" date.

Reference: CV2-5851.
  • Loading branch information
caiosba committed Feb 9, 2025
1 parent a6d1a86 commit 31431d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/graph/types/team_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def tipline_requests(from_timestamp:, to_timestamp:)

def articles(**args)
sort = args[:sort].to_s
order = [:title, :language, :updated_at, :id].include?(sort.downcase.to_sym) ? sort.downcase.to_sym : :title
order = [:title, :language, :updated_at, :created_at, :id].include?(sort.downcase.to_sym) ? sort.downcase.to_sym : :title
order_type = args[:sort_type].to_s.downcase.to_sym == :desc ? :desc : :asc
articles = Explainer.none
if args[:article_type] == 'explainer'
Expand Down

0 comments on commit 31431d0

Please sign in to comment.