2021-02-15 13:42:32 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-02-05 13:59:30 +01:00
|
|
|
class CustomWizard::RealtimeValidationsController < ::ApplicationController
|
2021-02-01 14:58:37 +01:00
|
|
|
def validate
|
|
|
|
params.require(:validation)
|
|
|
|
params.require(::CustomWizard::RealtimeValidation.types[params[:validation].to_sym][:required_params])
|
|
|
|
|
2021-02-15 13:42:32 +01:00
|
|
|
result = ::CustomWizard::RealtimeValidation.send(params[:validation], params, current_user)
|
|
|
|
render_serialized(result[:items], result[:serializer], result[:opts])
|
2021-02-01 14:58:37 +01:00
|
|
|
end
|
|
|
|
end
|