household: redirect to the household page when a household is created from a person

This commit is contained in:
nobohan 2021-12-10 17:40:40 +01:00
parent af87b3f6da
commit da12aedb53
2 changed files with 8 additions and 4 deletions

View File

@ -533,11 +533,15 @@ const store = createStore({
// nothing to do anymore here, bye-bye !
let params = new URLSearchParams(window.location.search);
if (params.has('followAfter')) {
window.location.replace(`/fr/person/household/${household_id}/summary`);
} else {
if (params.has('returnPath')) {
window.location.replace(params.get('returnPath'));
} else {
window.location.replace(`/fr/person/household/${household_id}/summary`);
}
}
} else {
// we assume the answer was 422...
error = household;

View File

@ -17,7 +17,7 @@
<ul class="record_actions">
<li>
<a class="btn btn-misc" href="{{chill_path_add_return_path('chill_person_household_members_editor', { 'persons': [ person.id ]}) }}">
<a class="btn btn-misc" href="{{chill_path_add_return_path('chill_person_household_members_editor', { 'persons': [ person.id ], 'followAfter': 'true'}) }}">
<i class="fa fa-sign-out"></i>
{{ 'household.Join'|trans }}
</a>