mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-10 06:49:49 +08:00
init project
This commit is contained in:
25
app/controllers/admins/library_applies_controller.rb
Normal file
25
app/controllers/admins/library_applies_controller.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
class Admins::LibraryAppliesController < Admins::BaseController
|
||||
def index
|
||||
params[:status] ||= 'pending'
|
||||
applies = Admins::LibraryApplyQuery.call(params)
|
||||
|
||||
@library_applies = paginate applies.preload(library: :user)
|
||||
end
|
||||
|
||||
def agree
|
||||
Libraries::AgreeApplyService.new(current_library_apply, current_user).call
|
||||
render_success_js
|
||||
end
|
||||
|
||||
def refuse
|
||||
Libraries::RefuseApplyService.new(current_library_apply, current_user, reason: params[:reason]).call
|
||||
|
||||
render_success_js
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def current_library_apply
|
||||
@_current_library_apply ||= LibraryApply.find(params[:id])
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user