Handle case of custom-field-only update
Dieser Commit ist enthalten in:
Ursprung
7841ee8101
Commit
fb06c0def2
1 geänderte Dateien mit 12 neuen und 11 gelöschten Zeilen
|
@ -97,19 +97,20 @@ class CustomWizard::Action
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_profile
|
def update_profile
|
||||||
return unless (profile_updates = action['profile_updates']).length
|
|
||||||
params = {}
|
params = {}
|
||||||
|
|
||||||
profile_updates.first[:pairs].each do |pair|
|
if (profile_updates = action['profile_updates'])
|
||||||
if allowed_profile_field?(pair['key'])
|
profile_updates.first[:pairs].each do |pair|
|
||||||
key = cast_profile_key(pair['key'])
|
if allowed_profile_field?(pair['key'])
|
||||||
value = cast_profile_value(mapper.map_field(pair['value'], pair['value_type']), pair['key'])
|
key = cast_profile_key(pair['key'])
|
||||||
|
value = cast_profile_value(mapper.map_field(pair['value'], pair['value_type']), pair['key'])
|
||||||
if user_field?(pair['key'])
|
|
||||||
params[:custom_fields] ||= {}
|
if user_field?(pair['key'])
|
||||||
params[:custom_fields][key] = value
|
params[:custom_fields] ||= {}
|
||||||
else
|
params[:custom_fields][key] = value
|
||||||
params[key.to_sym] = value
|
else
|
||||||
|
params[key.to_sym] = value
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Laden …
In neuem Issue referenzieren