import { useMutation, useQuery } from '@tanstack/react-query';
import * as api from '../service/ProfileService'
import { CheckUserNameType, UpdateProfileType } from '../types/ProfileTypes';

export const useGetProfile = () => {
    return useQuery({
        queryKey: ["profile"],
        queryFn: () => api.getProfile(),
    });
};

export const useCheckUserName = () => {
    return useMutation({
        mutationFn: (variables: CheckUserNameType) => api.checkUserName(variables),
    });
};

export const useUpdateProfile = () => {
    return useMutation({
        mutationFn: (variables: UpdateProfileType) => api.updateProfile(variables),
    });
};