13 lines
477 B
TypeScript
13 lines
477 B
TypeScript
import { NextResponse } from 'next/server'
|
|
import { METHODS, frappeCall } from '@/lib/lukenya-api'
|
|
|
|
// Current published legal documents (terms, indemnity, privacy, optional consents).
|
|
export async function GET() {
|
|
try {
|
|
const docs = await frappeCall<unknown[]>(METHODS.legalDocuments, { revalidate: 60 })
|
|
return NextResponse.json(docs || [], { headers: { 'Cache-Control': 'public, max-age=60' } })
|
|
} catch {
|
|
return NextResponse.json([], { status: 503 })
|
|
}
|
|
}
|