File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 11import { useMutation , useQueryClient } from "@tanstack/react-query" ;
22import { postLogin , postLogout } from "./auth.api" ;
3-
3+ import { userQueryKeys } from "@/shared/api/queries/user" ;
44export const useSocialLogin = ( ) => {
55 return useMutation ( {
66 mutationFn : ( {
@@ -19,6 +19,7 @@ export const useLogout = () => {
1919 mutationFn : postLogout ,
2020 onSuccess : ( ) => {
2121 queryClient . clear ( ) ;
22+ queryClient . invalidateQueries ( { queryKey : userQueryKeys . userInfo ( ) } ) ;
2223 } ,
2324 } ) ;
2425} ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { ENDPOINTS } from "@/shared/constants/endpoints";
33import type { UserInfo } from "@/shared/types/api/user" ;
44import { queryOptions } from "@tanstack/react-query" ;
55
6- const userQueryKeys = {
6+ export const userQueryKeys = {
77 all : ( ) => [ "user" ] ,
88 userInfo : ( ) => [ ...userQueryKeys . all ( ) , "userInfo" ] ,
99} as const ;
You can’t perform that action at this time.
0 commit comments