Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-25 18:50:27 +01:00
non working controller updates
Dieser Commit ist enthalten in:
Ursprung
582e2cca42
Commit
65979e1987
1 geänderte Dateien mit 12 neuen und 4 gelöschten Zeilen
|
@ -21,15 +21,23 @@ class CustomWizard::ApiController < ::ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def save
|
def save
|
||||||
|
byebug
|
||||||
params.require(:service)
|
params.require(:service)
|
||||||
service = params.permit(:service)
|
service = params.permit(:service)
|
||||||
|
auth_data = params[:auth_params]
|
||||||
|
endpoints_data = params[:endpoints]
|
||||||
|
|
||||||
data[:auth_params] = JSON.parse(@auth_data[:auth_params]) if @auth_data[:auth_params]
|
service_auth_data = JSON.parse(auth_data) if !auth_data.nil?
|
||||||
|
service_endpoints = JSON.parse(endpoints_data) if !endpoints_data.nil?
|
||||||
|
|
||||||
CustomWizard::Api::Authorization.set(service, @auth_data)
|
if !service_auth_data.nil?
|
||||||
|
CustomWizard::Api::Authorization.set(service, service_auth_data)
|
||||||
|
end
|
||||||
|
|
||||||
@endpoint_data.each do |endpoint|
|
if !service_endpoints.nil?
|
||||||
CustomWizard::Api::Endpoint.set(service, endpoint)
|
service_endpoints.each do |endpoint|
|
||||||
|
CustomWizard::Api::Endpoint.set(service, endpoint)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
render json: success_json.merge(
|
render json: success_json.merge(
|
||||||
|
|
Laden …
In neuem Issue referenzieren