import api from "../axios";
import { API_ENDPOINTS } from "../endpoints";
import { CurrentUserProfileSchema } from "../types";
export const profileService = {
  getProfile: async () => {
    try {
      const response = (await api.get(API_ENDPOINTS.PROFILE.READ)).data;

      return CurrentUserProfileSchema.parse(response.data);
    } catch (error) {
      console.error("ERROR caught in Profile Service: Get Profile", error);
      throw error;
    }
  },
};
