Skip to content

Commit

Permalink
Reorder republishing controller actions
Browse files Browse the repository at this point in the history
This makes them more chronological
  • Loading branch information
yndajas committed Apr 18, 2024
1 parent 8d329f9 commit 7c06a0c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/controllers/admin/republishing_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ def index
@republishable_pages = republishable_pages
end

def republish_page
def confirm_page
page_to_republish = republishable_pages.find { |page| page[:slug] == params[:page_slug] }

return render "admin/errors/not_found", status: :not_found unless page_to_republish

PresentPageToPublishingApiWorker.perform_async(page_to_republish[:presenter])
flash[:notice] = "'#{page_to_republish[:title]}' page has been scheduled for republishing"
redirect_to(admin_republishing_index_path)
@title = page_to_republish[:title]
@republishing_path = admin_republishing_page_republish_path(page_to_republish[:slug])
end

def confirm_page
def republish_page
page_to_republish = republishable_pages.find { |page| page[:slug] == params[:page_slug] }

return render "admin/errors/not_found", status: :not_found unless page_to_republish

@title = page_to_republish[:title]
@republishing_path = admin_republishing_page_republish_path(page_to_republish[:slug])
PresentPageToPublishingApiWorker.perform_async(page_to_republish[:presenter])
flash[:notice] = "'#{page_to_republish[:title]}' page has been scheduled for republishing"
redirect_to(admin_republishing_index_path)
end

private
Expand Down

0 comments on commit 7c06a0c

Please sign in to comment.