* Removed view field duplicate types * wip * wip 2 * wip 3 * Unified state for fields * Renaming * Wip * Post merge * Post post merge * wip * Delete unused file * Boolean and Probability * Finished InlineCell * Renamed EditableCell to TableCell * Finished double texts * Finished MoneyField * Fixed bug inline cell click outside * Fixed hotkey scope * Final fixes * Phone * Fix url and number input validation * Fix * Fix position * wip refactor activity editor * Fixed activity editor --------- Co-authored-by: Charles Bochet <charles@twenty.com>
16 lines
482 B
TypeScript
16 lines
482 B
TypeScript
import { useSetRecoilState } from 'recoil';
|
|
|
|
import { entityFieldsFamilyState } from '@/ui/field/states/entityFieldsFamilyState';
|
|
import { useGetCompanyQuery } from '~/generated/graphql';
|
|
|
|
export const useCompanyQuery = (id: string) => {
|
|
const updateCompanyShowPage = useSetRecoilState(entityFieldsFamilyState(id));
|
|
|
|
return useGetCompanyQuery({
|
|
variables: { where: { id } },
|
|
onCompleted: (data) => {
|
|
updateCompanyShowPage(data?.findUniqueCompany);
|
|
},
|
|
});
|
|
};
|