update workspace action to use repository from the workspace context
This commit is contained in:
committed by
Jacob Overgaard
parent
e128f59c3f
commit
ed4ac9de17
@@ -1,14 +1,10 @@
|
||||
import { UmbWorkspaceAction } from '../../../../shared/components/workspace/workspace-action';
|
||||
import { UmbDocumentWorkspaceContext } from '../document-workspace.context';
|
||||
import { UmbDocumentRepository } from '../../repository/document.repository';
|
||||
import { UmbControllerHostInterface } from '@umbraco-cms/controller';
|
||||
|
||||
export class UmbDocumentSaveAndPreviewWorkspaceAction extends UmbWorkspaceAction<
|
||||
UmbDocumentRepository,
|
||||
UmbDocumentWorkspaceContext
|
||||
> {
|
||||
constructor(host: UmbControllerHostInterface, repositoryAlias: string) {
|
||||
super(host, repositoryAlias);
|
||||
export class UmbDocumentSaveAndPreviewWorkspaceAction extends UmbWorkspaceAction<UmbDocumentWorkspaceContext> {
|
||||
constructor(host: UmbControllerHostInterface) {
|
||||
super(host);
|
||||
}
|
||||
|
||||
async execute() {
|
||||
@@ -17,6 +13,6 @@ export class UmbDocumentSaveAndPreviewWorkspaceAction extends UmbWorkspaceAction
|
||||
const document = this.workspaceContext.getData();
|
||||
// TODO: handle errors
|
||||
if (!document) return;
|
||||
this.repository?.saveAndPreview();
|
||||
this.workspaceContext.repository?.saveAndPreview();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user