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

export interface Grade {
  name: string;
  id: number;
  code: string;
}

export const fetchGrades = cache(async () => {
  return serverFetchJson<Grade[]>(`${BASE_API_URL}/grades`, {
    next: { tags: ["grades"] },
  });
});
