Refactor Views by cleaning the code, relying on apolloCache and improving performances (#4516)
* Wip refactoring view * Post merge conflicts * Fix review * Add create view capability * Fix create object missing view * Fix tests
This commit is contained in:
@ -21,7 +21,7 @@ import { isDefined } from '~/utils/isDefined';
|
||||
// TODO: create a generic way to have records only in cache for create mode and delete them afterwards ?
|
||||
export const useUpsertActivity = () => {
|
||||
const [isActivityInCreateMode, setIsActivityInCreateMode] = useRecoilState(
|
||||
isActivityInCreateModeState(),
|
||||
isActivityInCreateModeState,
|
||||
);
|
||||
|
||||
const { updateOneRecord: updateOneActivity } = useUpdateOneRecord<Activity>({
|
||||
@ -31,10 +31,10 @@ export const useUpsertActivity = () => {
|
||||
const { createActivityInDB } = useCreateActivityInDB();
|
||||
|
||||
const [, setIsUpsertingActivityInDB] = useRecoilState(
|
||||
isUpsertingActivityInDBState(),
|
||||
isUpsertingActivityInDBState,
|
||||
);
|
||||
|
||||
const setActivityIdInDrawer = useSetRecoilState(activityIdInDrawerState());
|
||||
const setActivityIdInDrawer = useSetRecoilState(activityIdInDrawerState);
|
||||
|
||||
const objectShowPageTargetableObject = useRecoilValue(
|
||||
objectShowPageTargetableObjectState,
|
||||
|
||||
Reference in New Issue
Block a user