import apiClient from "@/services/api.client";
import { API_ENDPOINTS } from "@/lib/constants/apiEndpoints";
import type {
  ProfileResponse,
  UpdateProfilePayload,
} from "@/types/api/profile.types";

export const profileService = {
  getProfile: () =>
    apiClient
      .post<ProfileResponse>(API_ENDPOINTS.GET_PROFILE, {})
      .then((r) => r.data),

  updateProfile: (payload: UpdateProfilePayload | FormData) =>
    apiClient
      .post<ProfileResponse>(API_ENDPOINTS.UPDATE_PROFILE, payload, {
        headers: payload instanceof FormData ? { "Content-Type": "multipart/form-data" } : undefined,
      })
      .then((r) => r.data),
};
