011d9e840f
* Removed isSomeInputInEditMode * Removed console.log * Added a first version of generic cell text * Removed metadata from entity table V1 * Fix * Fix * Fix
19 lines
415 B
TypeScript
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 },
|
|
},
|
|
});
|
|
};
|
|
}
|