add api class

This commit is contained in:
Mads Rasmussen
2024-05-24 18:40:13 +02:00
parent e873487da9
commit 338032d98f

View File

@@ -0,0 +1,18 @@
import { UMB_WORKSPACE_PATH_PATTERN } from '../paths.js';
import type { UmbWorkspaceElement } from '../workspace.element.js';
import type { IRoutingInfo, PageComponent, UmbRouteEntry } from '@umbraco-cms/backoffice/router';
import type { UmbApi } from '@umbraco-cms/backoffice/extension-api';
export class UmbWorkspaceSectionRouteEntry implements UmbApi, UmbRouteEntry {
getPath(): string {
return UMB_WORKSPACE_PATH_PATTERN.toString();
}
setup(element: PageComponent, info: IRoutingInfo) {
(element as UmbWorkspaceElement).entityType = info.match.params.entityType;
}
destroy(): void {}
}
export { UmbWorkspaceSectionRouteEntry as api };