forked from tuvn86/webapp-conversation
chore: add show api error msg
This commit is contained in:
parent
f6f65cff68
commit
25ef02d2aa
2 changed files with 12 additions and 5 deletions
|
|
@ -1,5 +1,3 @@
|
|||
export const dynamic = 'force-dynamic'
|
||||
|
||||
import { type NextRequest } from 'next/server'
|
||||
import { NextResponse } from 'next/server'
|
||||
import { client, getInfo, setSession } from '@/app/api/utils/common'
|
||||
|
|
@ -11,7 +9,11 @@ export async function GET(request: NextRequest) {
|
|||
return NextResponse.json(data, {
|
||||
headers: setSession(sessionId),
|
||||
})
|
||||
} catch (error) {
|
||||
return NextResponse.json([]);
|
||||
}
|
||||
catch (error: any) {
|
||||
return NextResponse.json({
|
||||
data: [],
|
||||
error: error.message,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue