feat: refactoring casl permission checks for recursive nested operations (#778)
* feat: nested casl abilities * fix: remove unused packages * Fixes * Fix createMany broken * Fix lint * Fix lint * Fix lint * Fix lint * Fixes * Fix CommentThread * Fix bugs * Fix lint * Fix bugs * Fixed auto routing * Fixed app path --------- Co-authored-by: Charles Bochet <charles@twenty.com> Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
|
||||
import { peopleEmailFamilyState } from '@/people/states/peopleEmailFamilyState';
|
||||
@ -15,29 +14,21 @@ export function EditablePeopleEmailCell() {
|
||||
peopleEmailFamilyState(currentRowEntityId ?? ''),
|
||||
);
|
||||
|
||||
const [internalValue, setInternalValue] = useState(email ?? '');
|
||||
|
||||
useEffect(() => {
|
||||
setInternalValue(email ?? '');
|
||||
}, [email]);
|
||||
|
||||
return (
|
||||
<EditableCellText
|
||||
value={internalValue}
|
||||
onChange={setInternalValue}
|
||||
onSubmit={() =>
|
||||
value={email || ''}
|
||||
onSubmit={(newEmail: string) =>
|
||||
updatePerson({
|
||||
variables: {
|
||||
where: {
|
||||
id: currentRowEntityId,
|
||||
},
|
||||
data: {
|
||||
email: internalValue,
|
||||
email: newEmail,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
onCancel={() => setInternalValue(email ?? '')}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user