2024-02-25 12:15:55 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2011-01-25 18:13:05 -05:00
|
|
|
class NoteVersionsController < ApplicationController
|
2019-11-26 17:03:43 -05:00
|
|
|
respond_to :html, :json
|
2013-03-19 08:10:10 -04:00
|
|
|
|
2011-01-25 18:13:05 -05:00
|
|
|
def index
|
2021-10-30 13:46:55 -04:00
|
|
|
@note_versions = NoteVersion.search(search_params).paginate(params[:page], limit: params[:limit])
|
2013-03-29 15:37:28 -04:00
|
|
|
respond_with(@note_versions) do |format|
|
2017-04-23 15:54:33 -04:00
|
|
|
format.html { @note_versions = @note_versions.includes(:updater) }
|
2013-03-29 15:37:28 -04:00
|
|
|
end
|
2011-01-25 18:13:05 -05:00
|
|
|
end
|
2021-10-30 13:46:55 -04:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def search_params
|
2023-02-05 14:48:56 -05:00
|
|
|
permitted_params = %i[updater_id updater_name post_id note_id is_active body_matches]
|
2022-11-28 10:21:40 -05:00
|
|
|
permitted_params += %i[ip_addr] if CurrentUser.is_admin?
|
2022-02-06 09:19:08 -05:00
|
|
|
permit_search_params permitted_params
|
2021-10-30 13:46:55 -04:00
|
|
|
end
|
2011-01-25 18:13:05 -05:00
|
|
|
end
|