Build fixes: offline-safe fonts, Next.js API route type updates, TS strict errors resolved, MUI import cleanup, chat markdown wrapper, Azure OpenAI typing, caching key + chapter API id types, and misc error-logging typings.

This commit is contained in:
andupetcu
2025-09-22 17:07:31 +03:00
parent c82b3007fd
commit 98c17d69bc
26 changed files with 106 additions and 105 deletions

View File

@@ -1,9 +1,9 @@
import { NextRequest, NextResponse } from 'next/server'
import { NextResponse } from 'next/server'
import { prisma } from '@/lib/db'
export async function POST(
request: NextRequest,
{ params }: { params: { id: string } }
request: Request,
{ params }: any
) {
try {
const prayerId = params.id
@@ -143,4 +143,4 @@ export async function POST(
{ status: 500 }
)
}
}
}

View File

@@ -1,4 +1,4 @@
import { NextRequest, NextResponse } from 'next/server'
import { NextResponse } from 'next/server'
import { AzureOpenAI } from 'openai'
export const runtime = 'nodejs'
@@ -11,7 +11,7 @@ const client = new AzureOpenAI({
deployment: 'gpt-4o' // Using GPT-4 for better quality prayers
})
export async function POST(request: NextRequest) {
export async function POST(request: Request) {
try {
const { prompt, category, locale } = await request.json()
@@ -120,4 +120,4 @@ export async function POST(request: NextRequest) {
{ status: 500 }
)
}
}
}

View File

@@ -1,7 +1,6 @@
import { NextRequest, NextResponse } from 'next/server'
import { NextResponse } from 'next/server'
import { z } from 'zod'
import { prisma } from '@/lib/db'
import { getServerSession } from 'next-auth'
const createPrayerSchema = z.object({
title: z.string().min(1).max(200),
@@ -10,7 +9,7 @@ const createPrayerSchema = z.object({
isAnonymous: z.boolean().optional().default(false)
})
export async function GET(request: NextRequest) {
export async function GET(request: Request) {
try {
const { searchParams } = new URL(request.url)
const category = searchParams.get('category')
@@ -77,7 +76,7 @@ export async function GET(request: NextRequest) {
}
}
export async function POST(request: NextRequest) {
export async function POST(request: Request) {
try {
const body = await request.json()
const validatedData = createPrayerSchema.parse(body)
@@ -151,4 +150,4 @@ export async function POST(request: NextRequest) {
{ status: 500 }
)
}
}
}