use unique and add entity-type
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { UMB_MEDIA_TYPE_ENTITY_TYPE, UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE } from '../entity.js';
|
||||
import { UmbMediaTypeTreeItemModel } from './types.js';
|
||||
import { MediaTypeResource, MediaTypeTreeItemResponseModel } from '@umbraco-cms/backoffice/backend-api';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
@@ -43,10 +44,10 @@ const getChildrenOf = (parentUnique: string | null) => {
|
||||
|
||||
const mapper = (item: MediaTypeTreeItemResponseModel): UmbMediaTypeTreeItemModel => {
|
||||
return {
|
||||
id: item.id,
|
||||
parentId: item.parentId || null,
|
||||
unique: item.id,
|
||||
parentUnique: item.parentId || null,
|
||||
name: item.name,
|
||||
entityType: 'media-type',
|
||||
entityType: item.isFolder ? UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE : UMB_MEDIA_TYPE_ENTITY_TYPE,
|
||||
hasChildren: item.hasChildren,
|
||||
isContainer: item.isContainer,
|
||||
isFolder: item.isFolder,
|
||||
|
||||
Reference in New Issue
Block a user