"use server"

import { serverFetchJson } from "@/app/utils/fetchUtil";
import { BASE_API_URL } from "@/config/api";
import { cache } from "react";

export interface comboProp {
  id: any;
  label: string;
}

export interface combo {
  records: comboProp[];
}
  
export const fetchGradeCombo = cache(async () => {
    return serverFetchJson<combo>(`${BASE_API_URL}/grades/combo`, {
      next: { tags: ["grades"] },
    });
  });