extend interface of the create scaffold preset

This commit is contained in:
Julia Gru
2023-07-18 13:39:05 +02:00
parent ec078bcc96
commit 3e6e39f948
2 changed files with 11 additions and 4 deletions

View File

@@ -1,9 +1,15 @@
import type { DataSourceResponse } from '@umbraco-cms/backoffice/repository';
export interface UmbDataSource<CreateRequestType, CreateResponseType, UpdateRequestType, ResponseType> {
export interface UmbDataSource<
CreateRequestType,
CreateResponseType,
UpdateRequestType,
ResponseType,
CreateScaffoldPresetType = Partial<CreateRequestType>
> {
createScaffold(
parentId: string | null,
preset?: Partial<CreateRequestType>
preset?: Partial<CreateRequestType> | CreateScaffoldPresetType
): Promise<DataSourceResponse<CreateRequestType>>;
get(unique: string): Promise<DataSourceResponse<ResponseType>>;
insert(data: CreateRequestType): Promise<DataSourceResponse<CreateResponseType>>;

View File

@@ -5,11 +5,12 @@ export interface UmbDetailRepository<
CreateRequestType = any,
CreateResponseType = any,
UpdateRequestType = any,
ResponseType = any
ResponseType = any,
CreateScaffoldPresetType = Partial<CreateRequestType>
> {
createScaffold(
parentId: string | null,
preset?: Partial<CreateRequestType>
preset?: Partial<CreateRequestType> | CreateScaffoldPresetType
): Promise<DataSourceResponse<CreateRequestType>>;
requestById(id: string): Promise<DataSourceResponse<ResponseType | undefined>>;
byId(id: string): Promise<Observable<ResponseType | undefined>>;