fix: build error on local
This commit is contained in:
parent
3d0958584c
commit
c2d8c9010a
3 changed files with 18 additions and 10 deletions
|
|
@ -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([]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue