refactor pickTemplate and adapt existing usage

This commit is contained in:
2022-02-01 15:49:23 +01:00
parent 5d2cb8c712
commit c6373a075d
9 changed files with 126 additions and 60 deletions

View File

@@ -0,0 +1,13 @@
const buildLink = function(templateId, entityId, entityClass) {
const
entityIdEncoded = encodeURI(entityId),
returnPath = encodeURIComponent(window.location.pathname + window.location.search + window.location.hash),
entityClassEncoded = encodeURI(entityClass),
url = `/fr/doc/gen/generate/from/${templateId}/for/${entityClassEncoded}/${entityIdEncoded}?returnPath=${returnPath}`
;
console.log('computed Url');
return url;
};
export {buildLink};