Update favorites query and state to work with new backend (#2520)

* wip

* wip

* adding favorite works in the database

* favorites are showing in the left drawer

* update favoorite NavItem link

* wip

* adding favorite works

* everything seems to work

* fix delete bug

* fix update favorite position

* update Favorite type

* Fix

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
bosiraphael
2023-11-15 16:17:50 +01:00
committed by GitHub
parent f49ddec2f6
commit 1fc3124d1e
14 changed files with 317 additions and 192 deletions

View File

@ -38,8 +38,7 @@ export const useAuth = () => {
const [verify] = useVerifyMutation();
const [checkUserExistsQuery, { data: checkUserExistsData }] =
useCheckUserExistsLazyQuery();
const [getCurrentWorkspaceQuery, { data: getCurrentWorkspaceData }] =
useGetCurrentWorkspaceLazyQuery();
const [getCurrentWorkspaceQuery] = useGetCurrentWorkspaceLazyQuery();
const client = useApolloClient();
@ -185,7 +184,13 @@ export const useAuth = () => {
return { user, workspaceMember, workspace };
},
[setIsVerifyPendingState, signUp, handleVerify, client],
[
setIsVerifyPendingState,
signUp,
handleVerify,
client,
setCurrentWorkspaceMember,
],
);
const handleGoogleLogin = useCallback((workspaceInviteHash?: string) => {