import apiClient from "@/lib/axiosClient";
import { API_ENDPOINTS } from "@/lib/apiEndpoints";
import { ApiResponse } from "@/types/api";
import { HomeSection, HomeTab } from "@/types/home";

export const homeService = {
  getSections: (tab: HomeTab): Promise<ApiResponse<HomeSection[]>> =>
    apiClient.post(API_ENDPOINTS.HOME.SECTION_LIST, { category: tab }).then((r) => r.data),

  getSectionDetail: (sectionId: string): Promise<ApiResponse<HomeSection>> =>
    apiClient.post(API_ENDPOINTS.HOME.SECTION_DETAIL, { section_id: sectionId }).then((r) => r.data),
};
