fix create empty

This commit is contained in:
Julia Gru
2023-07-21 17:11:14 +02:00
parent c7e070f38d
commit 4ffa3c0fa5
3 changed files with 11 additions and 6 deletions

View File

@@ -7,6 +7,6 @@ export class UmbCreateEmptyPartialViewAction<T extends { copy(): Promise<void> }
}
async execute() {
history.pushState(null, '', `section/settings/workspace/partial-view/create/${this.unique ?? 'null'}/`);
history.pushState(null, '', `section/settings/workspace/partial-view/create/${this.unique ?? 'null'}/Empty`);
}
}

View File

@@ -202,14 +202,20 @@ export class UmbPartialViewsRepository
createScaffold(parentId: string | null, preset: string): Promise<DataSourceResponse<TextFileResponseModelBaseModel>> {
return this.#detailDataSource.createScaffold(parentId, preset);
}
create(data: CreatePartialViewRequestModel): Promise<DataSourceResponse<any>> {
return this.#detailDataSource.insert(data);
async create(data: CreatePartialViewRequestModel): Promise<DataSourceResponse<any>> {
const promise = this.#detailDataSource.insert(data);
await promise;
this.requestTreeItemsOf(data.parentPath ? data.parentPath : null);
return promise;
}
save(id: string, requestBody: UpdatePartialViewRequestModel): Promise<UmbDataSourceErrorResponse> {
return this.#detailDataSource.update(id, requestBody);
}
delete(id: string): Promise<UmbDataSourceErrorResponse> {
return this.#detailDataSource.delete(id);
async delete(id: string): Promise<UmbDataSourceErrorResponse> {
const promise = this.#detailDataSource.delete(id);
const parentPath = id.substring(0, id.lastIndexOf('/'));
this.requestTreeItemsOf(parentPath ? parentPath : null);
return promise;
}
getSnippets({ skip = 0, take = 100 }): Promise<DataSourceResponse<PagedSnippetItemResponseModel>> {

View File

@@ -24,7 +24,6 @@ export class UmbPartialViewsWorkspaceElement extends UmbLitElement {
const parentKey = info.match.params.parentKey;
const decodePath = decodeURIComponent(parentKey);
const snippetName = info.match.params.snippetName;
this.#partialViewsWorkspaceContext.create(decodePath === 'null' ? null : parentKey, snippetName);
new UmbWorkspaceIsNewRedirectController(