fix: POC assigning in opportunities (#1443)

* fix: opportunities-poc-select

* gql codegen

* code review changes
This commit is contained in:
Aditya Pimpalkar
2023-09-11 00:08:44 +01:00
committed by GitHub
parent 2e798ef2ee
commit b6eb280639
3 changed files with 32 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import { useSearchPeopleQuery } from '~/generated/graphql';
export type OwnProps = {
personId: string | null;
companyId?: string;
onSubmit: (newPersonId: PersonForSelect | null) => void;
onCancel?: () => void;
onCreate?: () => void;
@ -20,6 +21,7 @@ export type PersonForSelect = EntityForSelect & {
export function PeoplePicker({
personId,
companyId,
onSubmit,
onCancel,
onCreate,
@ -33,10 +35,11 @@ export function PeoplePicker({
queryHook: useSearchPeopleQuery,
selectedIds: [personId ?? ''],
searchFilter: relationPickerSearchFilter,
filterByFields: [{ companyId: companyId ?? '' }],
mappingFunction: (person) => ({
entityType: Entity.Person,
id: person.id,
name: person.firstName + ' ' + person.lastName,
name: `${person.firstName} ${person.lastName}`,
avatarType: 'rounded',
avatarUrl: person.avatarUrl ?? '',
}),