#678 - Check field type of tags fields for tags rendering on item cards

This commit is contained in:
Elio Struyf
2023-09-30 11:25:06 +02:00
parent 414e980647
commit 90bfa87995
3 changed files with 28 additions and 15 deletions
@@ -62,7 +62,8 @@ export const Item: React.FunctionComponent<IItemProps> = ({
if (typeof tagsValue === 'string') {
return [tagsValue];
} else if (Array.isArray(tagsValue)) {
return tagsValue;
const items = tagsValue.map(t => typeof t === 'string' ? t : undefined);
return items.filter(t => t !== undefined) as string[];
}
return [];