RelationInputWrapper: Apply normalization to search results aswell

This commit is contained in:
Gustav Hansen 2022-08-24 12:00:11 +02:00
parent afc3b5252f
commit 77026fe24b
2 changed files with 4 additions and 2 deletions

View File

@ -102,7 +102,9 @@ export const RelationInputWrapper = ({
shouldAddLink: shouldDisplayRelationLink,
targetModel,
})}
searchResults={search}
searchResults={normalizeRelations(search, {
mainFieldName: mainField.name,
})}
/>
);
};

View File

@ -2,7 +2,7 @@ import { getRelationLink } from './getRelationLink';
export const normalizeRelations = (
relations,
{ deletions, shouldAddLink, mainFieldName, targetModel }
{ deletions = [], shouldAddLink = false, mainFieldName, targetModel }
) => {
return {
data: {