turkmen-expo/services/services.ts

19 lines
444 B
TypeScript
Raw Normal View History

2025-10-12 17:42:17 +00:00
import { baseAPI } from "@/lib/API";
import { ServicesType } from "@/lib/types/Services.data";
export const getServices = async (lang: string) => {
2025-10-12 17:42:17 +00:00
const res = await fetch(`${baseAPI}services`, {
headers: {
"Accept-Language": lang,
2025-10-12 17:42:17 +00:00
},
next: {
revalidate: 1000,
tags: [`services-${lang}`],
2025-10-12 17:42:17 +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;
};