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'
export async function GET(request: NextRequest) {
const { sessionId, user } = getInfo(request)
const { data }: any = await client.getConversations(user)
return NextResponse.json(data, {
headers: setSession(sessionId),
})
try {
const { data }: any = await client.getConversations(user)
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'
export async function GET(request: NextRequest) {
const { sessionId, user } = getInfo(request)
const { data } = await client.getApplicationParameters(user)
return NextResponse.json(data as object, {
headers: setSession(sessionId),
})
try {
const { data } = await client.getApplicationParameters(user)
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