Commit c2d8c901 authored by crazywoola's avatar crazywoola

fix: build error on local

parent 3d095858
...@@ -4,8 +4,12 @@ import { client, getInfo, setSession } from '@/app/api/utils/common' ...@@ -4,8 +4,12 @@ import { client, getInfo, setSession } from '@/app/api/utils/common'
export async function GET(request: NextRequest) { export async function GET(request: NextRequest) {
const { sessionId, user } = getInfo(request) const { sessionId, user } = getInfo(request)
const { data }: any = await client.getConversations(user) try {
return NextResponse.json(data, { const { data }: any = await client.getConversations(user)
headers: setSession(sessionId), return NextResponse.json(data, {
}) headers: setSession(sessionId),
})
} catch (error) {
return NextResponse.json([]);
}
} }
...@@ -4,8 +4,12 @@ import { client, getInfo, setSession } from '@/app/api/utils/common' ...@@ -4,8 +4,12 @@ import { client, getInfo, setSession } from '@/app/api/utils/common'
export async function GET(request: NextRequest) { export async function GET(request: NextRequest) {
const { sessionId, user } = getInfo(request) const { sessionId, user } = getInfo(request)
const { data } = await client.getApplicationParameters(user) try {
return NextResponse.json(data as object, { const { data } = await client.getApplicationParameters(user)
headers: setSession(sessionId), return NextResponse.json(data as object, {
}) headers: setSession(sessionId),
})
} catch (error) {
return NextResponse.json([]);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment