Weitere Verbesserungen des Starter Projekts für neue Projekte.

This commit is contained in:
2022-05-25 12:10:29 +02:00
parent 47fdee2396
commit 516c35dcb4
17 changed files with 398 additions and 301 deletions

View File

@@ -186,8 +186,11 @@ export const sendEmail = async (type: string = "contactForm", data: any, noToken
})
}
export const getContent = async (path: string): Promise<Content> => {
const c = await api<Content[]>("content", { limit: 1, filter: { path } })
export const getContent = async (path: string, lang: string): Promise<Content> => {
const c = await api<Content[]>("content", {
limit: 1,
filter: { path: path.replace("/" + lang, ""), locale: lang },
})
if (c?.data?.length) {
return c.data[0]
}