pass document type key when creating a document scaffold
This commit is contained in:
@@ -47,8 +47,9 @@ export class UmbDocumentServerDataSource implements RepositoryDetailDataSource<D
|
||||
* @return {*}
|
||||
* @memberof UmbDocumentServerDataSource
|
||||
*/
|
||||
async createScaffold(parentKey: string | null) {
|
||||
async createScaffold(documentTypeKey: string) {
|
||||
const data: DocumentModel = {
|
||||
contentTypeKey: documentTypeKey,
|
||||
values: [],
|
||||
variants: [],
|
||||
};
|
||||
|
||||
@@ -3,5 +3,6 @@ import type { DataSourceResponse } from '@umbraco-cms/models';
|
||||
import { RepositoryDetailDataSource } from '@umbraco-cms/repository';
|
||||
|
||||
export interface UmbDocumentDataSource extends RepositoryDetailDataSource<DocumentModel> {
|
||||
createScaffold(documentTypeKey: string): Promise<DocumentModel>;
|
||||
trash(key: string): Promise<DataSourceResponse<DocumentModel>>;
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@ export class UmbDocumentWorkspaceContext
|
||||
return data || undefined;
|
||||
}
|
||||
|
||||
async createScaffold(parentKey: string | null) {
|
||||
const { data } = await this.repository.createScaffold(parentKey);
|
||||
async createScaffold(documentTypeKey: string) {
|
||||
const { data } = await this.repository.createScaffold(documentTypeKey);
|
||||
if (!data) return undefined;
|
||||
|
||||
this.setIsNew(true);
|
||||
@@ -75,7 +75,7 @@ export class UmbDocumentWorkspaceContext
|
||||
},
|
||||
{
|
||||
name: 'create',
|
||||
path: 'create/:parentKey:/documentType',
|
||||
path: 'create/:parentKey/:documentTypeKey',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user