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:
@@ -1,10 +1,10 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { NextResponse } from 'next/server'
|
||||
import { prisma } from '@/lib/db'
|
||||
|
||||
// Ensure this route runs on the Node.js runtime (Prisma requires Node)
|
||||
export const runtime = 'nodejs'
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
export async function GET(request: Request) {
|
||||
try {
|
||||
console.log('Books API called')
|
||||
const { searchParams } = new URL(request.url)
|
||||
|
||||
@@ -7,7 +7,7 @@ export const runtime = 'nodejs'
|
||||
export async function GET(request: Request) {
|
||||
try {
|
||||
const { searchParams } = new URL(request.url)
|
||||
const bookId = parseInt(searchParams.get('book') || '1')
|
||||
const bookId = searchParams.get('book') || ''
|
||||
const chapterNum = parseInt(searchParams.get('chapter') || '1')
|
||||
|
||||
// Check cache first
|
||||
|
||||
@@ -4,10 +4,10 @@ import { prisma } from '@/lib/db'
|
||||
export const runtime = 'nodejs'
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const { searchParams } = new URL(request.url)
|
||||
const query = searchParams.get('q')
|
||||
const limit = parseInt(searchParams.get('limit') || '10')
|
||||
try {
|
||||
const { searchParams } = new URL(request.url)
|
||||
const query = searchParams.get('q')
|
||||
const limit = parseInt(searchParams.get('limit') || '10')
|
||||
|
||||
if (!query) {
|
||||
return NextResponse.json({ error: 'Termenul de căutare este obligatoriu' }, { status: 400 })
|
||||
@@ -34,7 +34,7 @@ export async function GET(request: Request) {
|
||||
const fallbackResults = await prisma.bibleVerse.findMany({
|
||||
where: {
|
||||
text: {
|
||||
contains: query,
|
||||
contains: query || '',
|
||||
mode: 'insensitive'
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { NextResponse } from 'next/server'
|
||||
import { prisma } from '@/lib/db'
|
||||
|
||||
export const runtime = 'nodejs'
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
export async function GET(request: Request) {
|
||||
try {
|
||||
const { searchParams } = new URL(request.url)
|
||||
const bookId = searchParams.get('bookId')
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { NextResponse } from 'next/server'
|
||||
import { prisma } from '@/lib/db'
|
||||
|
||||
export const runtime = 'nodejs'
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
export async function GET(request: Request) {
|
||||
try {
|
||||
const { searchParams } = new URL(request.url)
|
||||
const locale = (searchParams.get('locale') || 'ro').toLowerCase()
|
||||
@@ -30,4 +30,3 @@ export async function GET(request: NextRequest) {
|
||||
return NextResponse.json({ success: false, versions: [] }, { status: 500 })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user