Hard coded the URL

This commit is contained in:
Tiago Ribeiro
2024-03-13 23:58:56 +00:00
parent a24a8ec097
commit 3c5629f83a

View File

@@ -12,9 +12,7 @@ interface Props {
}
async function getCountryManagers(country: string, language: Language = "en") {
const res = await fetch(
`${process.env.NEXT_PUBLIC_APP_URL}/api/users/agents/${country}?language=${language}`
);
const res = await fetch(`https://platform.encoach.com/api/users/agents/${country}?language=${language}`);
if (!res.ok) {
throw new Error("Failed to fetch contacts");
@@ -24,9 +22,7 @@ async function getCountryManagers(country: string, language: Language = "en") {
}
export async function generateStaticParamsHelper(language: Language = "en") {
const contacts = (await fetch(
`${process.env.NEXT_PUBLIC_APP_URL}/api/users/agents?language=${language}`
).then((res) => res.json())) as Contact[];
const contacts = (await fetch(`https://platform.encoach.com/api/users/agents?language=${language}`).then((res) => res.json())) as Contact[];
return contacts.map(({key}) => ({
country: key.toLowerCase().replaceAll(" ", ""),
}));