Skip to content
Snippets Groups Projects
Unverified Commit 19c0baa9 authored by xgui3783's avatar xgui3783 Committed by GitHub
Browse files

fix tmpl preview url (#560)

parent a5931987
No related branches found
No related tags found
No related merge requests found
......@@ -57,8 +57,15 @@ router.get('/:atlasId', async (req, res) => {
}),
templateSpaces: templateSpaces.map(tmpl => {
const lastTemplatePath = `${encodeURIComponent(atlasId)}/template/${encodeURIComponent(tmpl['@id'])}`
const searchParam = new url.URLSearchParams()
searchParam.set('id', tmpl['@id'])
const lastPathPreview = `preview?${searchParam.toString()}`
return {
...tmpl,
previewUrl: res.locals.routePathname
? url.resolve(`${res.locals.routePathname}/`, lastPathPreview)
: lastPathPreview,
url: res.locals.routePathname
? url.resolve(`${res.locals.routePathname}/`, lastTemplatePath)
: lastTemplatePath
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment