export type Service = {
  id: string;

  title_fr: string;
  title_en: string;

  description_fr: string;
  description_en: string;

  image?: string | null;

  createdAt: string;
};

export async function getServices(): Promise<Service[]> {
  const res = await fetch(
    "http://localhost:3000/api/services",
    {
      cache: "no-store",
    }
  );

  if (!res.ok) {
    return [];
  }

  return res.json();
}