fix: POC assigning in opportunities (#1443)
* fix: opportunities-poc-select * gql codegen * code review changes
This commit is contained in:
@ -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 ?? '',
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user