On Company Show, I can select an existing person and add it to the company (#1201)
* On Company Show, I can select an existing person and add it to the company Co-authored-by: Matheus <matheus_benini@hotmail.com> Co-authored-by: v1b3m <vibenjamin6@gmail.com> * Add requested changes Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> * Add excludePersonIds Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> * Add hotkey support * Fix popin placement and fix company show mobile * Fix popin placement and fix company show mobile --------- Co-authored-by: Matheus <matheus_benini@hotmail.com> Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -60,6 +60,7 @@ export function useFilteredSearchEntityQuery<
|
||||
mappingFunction,
|
||||
limit,
|
||||
searchFilter, // TODO: put in a scoped recoil state
|
||||
excludePersonIds = [],
|
||||
}: {
|
||||
queryHook: (
|
||||
queryOptions?: Apollo.QueryHookOptions<
|
||||
@ -74,6 +75,7 @@ export function useFilteredSearchEntityQuery<
|
||||
mappingFunction: (entity: EntityType) => CustomEntityForSelect;
|
||||
limit?: number;
|
||||
searchFilter: string;
|
||||
excludePersonIds?: string[];
|
||||
}): EntitiesForMultipleEntitySelect<CustomEntityForSelect> {
|
||||
const { loading: selectedEntitiesLoading, data: selectedEntitiesData } =
|
||||
queryHook({
|
||||
@ -129,7 +131,7 @@ export function useFilteredSearchEntityQuery<
|
||||
},
|
||||
{
|
||||
id: {
|
||||
notIn: selectedIds,
|
||||
notIn: [...selectedIds, ...excludePersonIds],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user