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", field: "entity",
headerName: t("label.entity"), headerName: t("label.entity"),
flex: 1, flex: 1,
valueGetter: (row: IContent) => { valueGetter: (entityId) => {
const contentType = getEntityFromCache(row.id); const contentType = getEntityFromCache(entityId);
return contentType?.name; return contentType?.name;
}, },

View File

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