Files
twenty/front/src/modules/people/hooks/useUpdatePeopleField.ts
T
Lucas Bordeau 011d9e840f Feat/improve editable cell (#959)
* Removed isSomeInputInEditMode

* Removed console.log

* Added a first version of generic cell text

* Removed metadata from entity table  V1

* Fix

* Fix

* Fix
2023-07-26 22:53:57 -07:00

19 lines
415 B
TypeScript

import { useUpdateOnePersonMutation } from '~/generated/graphql';
export function useUpdatePeopleField() {
const [updatePeople] = useUpdateOnePersonMutation();
return function updatePeopleField(
peopleId: string,
fieldName: string,
fieldValue: unknown,
) {
updatePeople({
variables: {
where: { id: peopleId },
data: { [fieldName]: fieldValue },
},
});
};
}