import axios from "../../../config/axios";
import { CheckUserNameType, UpdateProfileType } from "../types/ProfileTypes";

export const getProfile = async () => {
  const { data } = await axios.get(`/users/me`);
  return data;
};

export const checkUserName = async (params: CheckUserNameType) => {
  const { data } = await axios.post(`/users/check-validity`, params);
  return data;
};

export const updateProfile = async (params: UpdateProfileType) => {
  const { data } = await axios.patch(`/users/update-profile`, params);
  return data;
};
