From b39b897a7bf2d8260fe6bdee8079a268a8cec1c1 Mon Sep 17 00:00:00 2001 From: Aramis Sennyey Date: Mon, 6 Mar 2023 11:25:44 -0500 Subject: [PATCH] Fix variable names. Signed-off-by: Aramis Sennyey --- .../components/EntityOwnerPicker/EntityOwnerPicker.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.tsx b/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.tsx index d4a21a4dd5..d755f2a84f 100644 --- a/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.tsx +++ b/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.tsx @@ -93,7 +93,7 @@ export const EntityOwnerPicker = () => { .filter(Boolean) as string[], ), ]; - const { items } = await catalogApi.getEntitiesByRefs({ + const { items: ownerEntitiesOrNull } = await catalogApi.getEntitiesByRefs({ entityRefs: ownerEntityRefs, fields: [ 'kind', @@ -103,8 +103,7 @@ export const EntityOwnerPicker = () => { 'spec.profile.displayName', ], }); - const owners = ownerEntityRefs.map((ref, index) => { - const entity = items[index]; + const owners = ownerEntitiesOrNull.map((entity, index) => { if (entity) { return { label: humanizeEntity(entity, { defaultKind: 'Group' }), @@ -113,10 +112,10 @@ export const EntityOwnerPicker = () => { } return { label: humanizeEntityRef( - parseEntityRef(ref, { defaultKind: 'Group' }), + parseEntityRef(ownerEntityRefs[index], { defaultKind: 'Group' }), { defaultKind: 'group' }, ), - entityRef: ref, + entityRef: ownerEntityRefs[index], }; });