feat(core): preview template & snapshot import (#8193)

This commit is contained in:
EYHN
2024-09-11 07:11:33 +00:00
parent 52d9569f47
commit 8c191e6baa
9 changed files with 123 additions and 29 deletions

View File

@@ -94,6 +94,19 @@ export const topLevelRoutes = [
path: '/template/import',
lazy: () => import('./pages/import-template'),
},
{
path: '/template/preview',
loader: ({ request }) => {
const url = new URL(request.url);
const workspaceId = url.searchParams.get('workspaceId');
const docId = url.searchParams.get('docId');
const templateName = url.searchParams.get('name');
return redirect(
`/workspace/${workspaceId}/${docId}?isTemplate=true&templateName=${encodeURIComponent(templateName ?? '')}`
);
},
},
{
path: '/auth/:authType',
lazy: () => import(/* webpackChunkName: "auth" */ './pages/auth/auth'),