forked from cms/tibi-svelte-starter
Weitere Verbesserungen des Starter Projekts für neue Projekte.
This commit is contained in:
@@ -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]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user