Fix advance response status check for stage progression
The advance API returns instance status ("active"/"completed") but
the template JS checked for "advanced" which was never returned.
On successful advance while instance is still active, reload the
page to render the next stage.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -452,16 +452,13 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Success
|
// Success — API returns instance status: "active" (advanced) or "completed"
|
||||||
if (result.status === 'advanced' || result.status === 'completed') {
|
if (result.status === 'completed') {
|
||||||
showFormSuccess(result.status === 'completed'
|
showFormSuccess('Thank you! Your submission is complete.');
|
||||||
? 'Thank you! Your submission is complete.'
|
|
||||||
: 'Submitted! Moving to the next step...');
|
|
||||||
if (result.status === 'advanced') {
|
|
||||||
setTimeout(function() { window.location.reload(); }, 1500);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
showFormSuccess('Your response has been submitted.');
|
// Still active = advanced to next stage — reload to render it
|
||||||
|
showFormSuccess('Submitted! Moving to the next step...');
|
||||||
|
setTimeout(function() { window.location.reload(); }, 1500);
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
alert('Network error: ' + e.message);
|
alert('Network error: ' + e.message);
|
||||||
|
|||||||
Reference in New Issue
Block a user