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,4 +1,4 @@
import { NextRequest, NextResponse } from 'next/server'
import { NextResponse } from 'next/server'
import { z } from 'zod'
import { PrismaClient } from '@prisma/client'
import { verifyToken } from '@/lib/auth'
@@ -14,8 +14,8 @@ const updateConversationSchema = z.object({
// GET /api/chat/conversations/[id] - Get conversation with messages
export async function GET(
request: NextRequest,
{ params }: { params: { id: string } }
request: Request,
{ params }: any
) {
try {
// Get user from authentication
@@ -28,7 +28,7 @@ export async function GET(
}
const token = authHeader.substring(7)
const payload = verifyToken(token)
const payload = await verifyToken(token)
if (!payload) {
return NextResponse.json(
@@ -100,8 +100,8 @@ export async function GET(
// PUT /api/chat/conversations/[id] - Update conversation
export async function PUT(
request: NextRequest,
{ params }: { params: { id: string } }
request: Request,
{ params }: any
) {
try {
// Get user from authentication
@@ -114,7 +114,7 @@ export async function PUT(
}
const token = authHeader.substring(7)
const payload = verifyToken(token)
const payload = await verifyToken(token)
if (!payload) {
return NextResponse.json(
@@ -198,8 +198,8 @@ export async function PUT(
// DELETE /api/chat/conversations/[id] - Delete conversation
export async function DELETE(
request: NextRequest,
{ params }: { params: { id: string } }
request: Request,
{ params }: any
) {
try {
// Get user from authentication
@@ -212,7 +212,7 @@ export async function DELETE(
}
const token = authHeader.substring(7)
const payload = verifyToken(token)
const payload = await verifyToken(token)
if (!payload) {
return NextResponse.json(
@@ -263,4 +263,4 @@ export async function DELETE(
{ status: 500 }
)
}
}
}