Browse Source

set default desc sort for faqs api

tags/v3.0.4(standalone)
jasder 5 years ago
parent
commit
8ee0acae85
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      app/controllers/admins/faqs_controller.rb
  2. +1
    -1
      app/controllers/helps/faqs_controller.rb

+ 1
- 1
app/controllers/admins/faqs_controller.rb View File

@@ -2,7 +2,7 @@ class Admins::FaqsController < Admins::BaseController
before_action :find_faq, only: [:edit,:update, :destroy]

def index
sort_by = params[:sort_by] ||= 'created_at'
sort_by = params[:sort_by] ||= 'updated_at'
sort_direction = params[:sort_direction] ||= 'desc'

keyword = params[:keyword].to_s.strip


+ 1
- 1
app/controllers/helps/faqs_controller.rb View File

@@ -2,7 +2,7 @@ class Helps::FaqsController < ApplicationController
skip_before_action :check_sign, :user_setup

def index
faqs = Faq.select_without_id
faqs = Faq.select_without_id.order(updated_at: :desc)
render json: faqs.as_json(:except => [:id])
end
end

Loading…
Cancel
Save