correct null routing

This commit is contained in:
Julia Gru
2023-08-28 08:53:02 +02:00
parent 5acc7192c4
commit 75faffbb6b

View File

@@ -15,12 +15,11 @@ export class UmbStylesheetWorkspaceElement extends UmbLitElement {
@state()
_routes: UmbRoute[] = [
{
path: 'create/:parentId',
path: 'create/:path',
component: () => this.#element,
setup: async (_component, info) => {
const path = info.match.params.parentId;
const serverPath = serverFilePathFromUrlFriendlyPath(path);
this.#workspaceContext.setIsNew(true);
const path = info.match.params.path === 'null' ? null : info.match.params.path;
const serverPath = path === null ? null : serverFilePathFromUrlFriendlyPath(path);
await this.#workspaceContext.create(serverPath);
new UmbWorkspaceIsNewRedirectController(