1
0
Fork 0

Improve redirect code clarity

Dieser Commit ist enthalten in:
Angus McLeod 2019-08-29 09:51:18 +10:00
Ursprung 69c25171d5
Commit ad18ec9809
2 geänderte Dateien mit 6 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -5,8 +5,8 @@ export default StepController.extend({
actions: {
goNext(response) {
const next = this.get('step.next');
if (response.route_to) {
window.location.href = response.route_to;
if (response.redirect_on_next) {
window.location.href = response.redirect_on_next;
} else if (response.refresh_required) {
const id = this.get('wizard.id');
window.location.href = getUrl(`/w/${id}/steps/${next}`);

Datei anzeigen

@ -161,12 +161,10 @@ class CustomWizard::Builder
end
if updater.errors.empty?
if route_to = data['route_to']
updater.result[:route_to] = route_to
end
if redirect_on_complete = data['redirect_on_complete']
updater.result[:redirect_on_complete] = redirect_on_complete
if final_step
updater.result[:redirect_on_complete] = data['redirect_on_complete'] || data['route_to']
elsif route_to = data['route_to']
updater.result[:redirect_on_next] = route_to
end
end
end