mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 22:35:03 +08:00
Clean up wizard updater API for better plugin use
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
require_dependency 'wizard'
|
||||
require_dependency 'wizard/builder'
|
||||
require_dependency 'wizard/step_updater'
|
||||
|
||||
class StepsController < ApplicationController
|
||||
@ -7,7 +8,8 @@ class StepsController < ApplicationController
|
||||
before_filter :ensure_staff
|
||||
|
||||
def update
|
||||
updater = Wizard::StepUpdater.new(current_user, params[:id])
|
||||
wizard = Wizard::Builder.new(current_user).build
|
||||
updater = wizard.create_updater(params[:id])
|
||||
updater.update(params[:fields])
|
||||
|
||||
if updater.success?
|
||||
|
Reference in New Issue
Block a user