This commit is contained in:
parent
7cb2321c02
commit
dc01d7fc3e
|
@ -70,11 +70,16 @@ class Api::V1::Issues::MilestonesController < Api::V1::BaseController
|
|||
end
|
||||
|
||||
def sort_by
|
||||
Version.columns.include?(params.fetch(:sort_by, "created_on")) ? params.fetch(:sort_by, "created_on") : "created_on"
|
||||
sort_by = params.fetch(:sort_by, "created_on")
|
||||
sort_by = Version.column_names.include?(sort_by) ? sort_by : "created_on"
|
||||
|
||||
sort_by
|
||||
end
|
||||
|
||||
def sort_direction
|
||||
%w(desc asc).include?(params.fetch(:sort_direction, "desc")) ? params.fetch(:sort_direction, "desc") : "desc"
|
||||
def sort_direction
|
||||
sort_direction = params.fetch(:sort_direction, "desc").downcase
|
||||
sort_direction = %w(desc asc).include?(sort_direction) ? sort_direction : "desc"
|
||||
sort_direction
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue