From 8bbb12da5a542320dfd770cf320bb1645d14b43e Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 17 Feb 2025 13:47:02 +0100 Subject: [PATCH] generate server models + fix client --- .../src/external/backend-api/src/types.gen.ts | 5 +++++ .../src/mocks/data/document/document.db.ts | 2 ++ .../src/mocks/data/tracked-reference.data.ts | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/external/backend-api/src/types.gen.ts b/src/Umbraco.Web.UI.Client/src/external/backend-api/src/types.gen.ts index be5966855a..24fb93da0d 100644 --- a/src/Umbraco.Web.UI.Client/src/external/backend-api/src/types.gen.ts +++ b/src/Umbraco.Web.UI.Client/src/external/backend-api/src/types.gen.ts @@ -565,6 +565,7 @@ export type DataTypeTreeItemResponseModel = { }; export type DefaultReferenceResponseModel = { + $type: string; id: string; name?: (string) | null; type?: (string) | null; @@ -640,6 +641,8 @@ export type DocumentCollectionResponseModel = { creator?: (string) | null; sortOrder: number; documentType: (DocumentTypeCollectionReferenceResponseModel); + isTrashed: boolean; + isProtected: boolean; updater?: (string) | null; }; @@ -686,6 +689,7 @@ export type DocumentRecycleBinItemResponseModel = { }; export type DocumentReferenceResponseModel = { + $type: string; id: string; name?: (string) | null; published?: (boolean) | null; @@ -1213,6 +1217,7 @@ export type MediaRecycleBinItemResponseModel = { }; export type MediaReferenceResponseModel = { + $type: string; id: string; name?: (string) | null; mediaType: (TrackedReferenceMediaTypeModel); diff --git a/src/Umbraco.Web.UI.Client/src/mocks/data/document/document.db.ts b/src/Umbraco.Web.UI.Client/src/mocks/data/document/document.db.ts index a03fd6e6f3..214ed14921 100644 --- a/src/Umbraco.Web.UI.Client/src/mocks/data/document/document.db.ts +++ b/src/Umbraco.Web.UI.Client/src/mocks/data/document/document.db.ts @@ -146,6 +146,8 @@ const collectionMapper = (model: UmbMockDocumentModel): DocumentCollectionRespon icon: model.documentType.icon, }, id: model.id, + isProtected: model.isProtected, + isTrashed: model.isTrashed, sortOrder: 0, updater: null, values: model.values, diff --git a/src/Umbraco.Web.UI.Client/src/mocks/data/tracked-reference.data.ts b/src/Umbraco.Web.UI.Client/src/mocks/data/tracked-reference.data.ts index 868f48c3e7..bbd02fb59b 100644 --- a/src/Umbraco.Web.UI.Client/src/mocks/data/tracked-reference.data.ts +++ b/src/Umbraco.Web.UI.Client/src/mocks/data/tracked-reference.data.ts @@ -8,6 +8,7 @@ export const items: Array< DefaultReferenceResponseModel | DocumentReferenceResponseModel | MediaReferenceResponseModel > = [ { + $type: 'DocumentReferenceResponseModel', id: 'simple-document-id', name: 'Simple Document', published: true, @@ -18,6 +19,7 @@ export const items: Array< }, } satisfies DocumentReferenceResponseModel, { + $type: 'DocumentReferenceResponseModel', id: '1234', name: 'Image Block', published: true, @@ -28,6 +30,7 @@ export const items: Array< }, } satisfies DocumentReferenceResponseModel, { + $type: 'MediaReferenceResponseModel', id: 'media-id', name: 'Simple Media', mediaType: { @@ -37,6 +40,7 @@ export const items: Array< }, } satisfies MediaReferenceResponseModel, { + $type: 'DefaultReferenceResponseModel', id: 'default-id', name: 'Some other reference', type: 'Default',