feat(client): user info

Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit was merged in pull request #1.
This commit is contained in:
2025-12-25 02:50:23 +08:00
committed by Asai Neko
parent 9ac598cd98
commit be3d778420
5 changed files with 37 additions and 18 deletions

View File

@@ -0,0 +1,21 @@
import { useSuspenseQuery } from '@tanstack/react-query';
import { axiosClient } from '@/lib/axios';
export function useUserInfo() {
return useSuspenseQuery({
queryKey: ['userInfo'],
queryFn: async () => {
const response = await axiosClient.get<{
user_id: string;
email: string;
type: string;
nickname: string;
subtitle: string;
avatar: string;
checkin: string | null;
}
>('/user/info');
return response.data;
},
});
}