import { apiClient } from "./client";
import { endpoints } from "./endpoints";

export const pagesApi = {
  listByPackage: async (packageId: string | number) => {
    const res = await apiClient.get(endpoints.pages.list, {
      params: { package: packageId },
    });
    return Array.isArray(res.data) ? res.data : [];
  },
  getById: async (id: string | number) => {
    const res = await apiClient.get(endpoints.pages.detail(id));
    return res.data;
  }
};
