initiate drf app

This commit is contained in:
2025-05-15 18:26:23 +03:00
commit 8e3dfd89b1
86 changed files with 9340 additions and 0 deletions

18
frontend/lib/fetchFAQ.ts Normal file
View File

@@ -0,0 +1,18 @@
import { FAQ, FAQProps } from '@/app/types'
export async function getFAQs(): Promise<FAQ[]> {
const API_URL = process.env.NEXT_PUBLIC_API_URL
const response = await fetch(`${API_URL}/faq/`, {
next: {
revalidate: 259200, // три дня
},
})
if (!response.ok) {
throw new Error('Failed to fetch FAQs')
}
const data: FAQProps = await response.json()
return data.faqs
}