make sure there is an id when creating the scaffold
This commit is contained in:
@@ -19,7 +19,12 @@ import type { UmbDataSource } from '@umbraco-cms/backoffice/repository';
|
||||
*/
|
||||
export class UmbDictionaryDetailServerDataSource
|
||||
implements
|
||||
UmbDataSource<CreateDictionaryItemRequestModel, any, UpdateDictionaryItemRequestModel, DictionaryItemResponseModel>
|
||||
UmbDataSource<
|
||||
CreateDictionaryItemRequestModel,
|
||||
string,
|
||||
UpdateDictionaryItemRequestModel,
|
||||
DictionaryItemResponseModel
|
||||
>
|
||||
{
|
||||
#host: UmbControllerHost;
|
||||
|
||||
@@ -33,13 +38,11 @@ export class UmbDictionaryDetailServerDataSource
|
||||
* @return {*}
|
||||
* @memberof UmbDictionaryDetailServerDataSource
|
||||
*/
|
||||
async createScaffold(parentId?: string | null, preset?: Partial<CreateDictionaryItemRequestModel>) {
|
||||
async createScaffold(parentId: string | null, preset?: Partial<CreateDictionaryItemRequestModel>) {
|
||||
const data = {
|
||||
...preset,
|
||||
id: UmbId.new(),
|
||||
parentId,
|
||||
name: '',
|
||||
translations: [],
|
||||
...preset,
|
||||
};
|
||||
|
||||
return { data };
|
||||
|
||||
Reference in New Issue
Block a user