fix(frontend): add contentEntity normalization logic

This commit is contained in:
yassinedorbozgithub 2024-10-03 17:40:07 +01:00
parent d169bdbe92
commit b3426e3f50
2 changed files with 10 additions and 6 deletions

View File

@ -165,8 +165,8 @@ export const Contents = () => {
field: "entity",
headerName: t("label.entity"),
flex: 1,
valueGetter: (row: IContent) => {
const contentType = getEntityFromCache(row.id);
valueGetter: (entityId) => {
const contentType = getEntityFromCache(entityId);
return contentType?.name;
},

View File

@ -164,10 +164,14 @@ export const ContentTypeEntity = new schema.Entity(
},
);
export const ContentEntity = new schema.Entity(EntityType.CONTENT, undefined, {
idAttribute: ({ id }) => id,
processStrategy: processCommonStrategy,
});
export const ContentEntity = new schema.Entity(
EntityType.CONTENT,
{ entity: ContentTypeEntity },
{
idAttribute: ({ id }) => id,
processStrategy: processCommonStrategy,
},
);
export const SettingEntity = new schema.Entity(EntityType.SETTING, {
idAttribute: ({ id }) => id,