2025-10-12 17:42:17 +00:00
|
|
|
import { baseAPI } from "@/lib/API";
|
|
|
|
|
import { ServicesType } from "@/lib/types/Services.data";
|
|
|
|
|
|
2026-02-11 20:45:37 +00:00
|
|
|
export const getServices = async (lang: string) => {
|
2025-10-12 17:42:17 +00:00
|
|
|
const res = await fetch(`${baseAPI}services`, {
|
|
|
|
|
headers: {
|
2026-02-11 20:45:37 +00:00
|
|
|
"Accept-Language": lang,
|
2025-10-12 17:42:17 +00:00
|
|
|
},
|
|
|
|
|
next: {
|
|
|
|
|
revalidate: 1000,
|
2026-02-11 20:45:37 +00:00
|
|
|
tags: [`services-${lang}`],
|
2025-10-12 17:42:17 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2026-02-11 20:45:37 +00:00
|
|
|
if (!res.ok) throw new Error("Failed to load services");
|
2025-10-12 17:42:17 +00:00
|
|
|
|
|
|
|
|
return (await res.json()) as ServicesType;
|
|
|
|
|
};
|