const API_URL = process.env.NEXT_PUBLIC_API_URL;

export async function getCarsRequest() {
  const response = await fetch(`${API_URL}/cars`, {
    next: {
      revalidate: 3600,
    },
  });

  if (!response.ok) {
    throw new Error(`Failed to fetch cars (${response.status})`);
  }

  return await response.json();
}
