on the fly component: add returnPath when viewing

This commit is contained in:
nobohan 2022-02-01 17:44:55 +01:00
parent 5d2cb8c712
commit a78f29cffc

View File

@ -160,7 +160,10 @@ export default {
},
badgeType() {
return 'entity-' + this.type + ' badge-' + this.type;
}
},
getReturnPath() {
return `?returnPath=${window.location.pathname}${window.location.search}${window.location.hash}`;
},
},
watch: {
canCloseModal: {
@ -217,9 +220,9 @@ export default {
buildLocation(id, type) {
if (type === 'person') {
// TODO i18n
return `/fr/person/${id}/general`;
return encodeURI(`/fr/person/${id}/general${this.getReturnPath}`);
} else if (type === 'thirdparty') {
return `/fr/3party/3party/${id}/view`;
return encodeURI(`/fr/3party/3party/${id}/view${this.getReturnPath}`);
}
}
}