fix: build error on local

This commit is contained in:
crazywoola
2023-07-31 18:31:18 +08:00
parent 3d0958584c
commit c2d8c9010a
3 changed files with 18 additions and 10 deletions

View File

@ -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([]);
}
} }

View File

@ -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([]);
}
} }

View File

@ -28,7 +28,7 @@
"copy-to-clipboard": "^3.3.3", "copy-to-clipboard": "^3.3.3",
"dify-client": "2.0.0", "dify-client": "2.0.0",
"eslint": "8.36.0", "eslint": "8.36.0",
"eslint-config-next": "13.2.4", "eslint-config-next": "13.4.0",
"eventsource-parser": "^1.0.0", "eventsource-parser": "^1.0.0",
"husky": "^8.0.3", "husky": "^8.0.3",
"i18next": "^22.4.13", "i18next": "^22.4.13",
@ -37,7 +37,7 @@
"js-cookie": "^3.0.1", "js-cookie": "^3.0.1",
"katex": "^0.16.7", "katex": "^0.16.7",
"negotiator": "^0.6.3", "negotiator": "^0.6.3",
"next": "13.2.4", "next": "13.4.0",
"react": "18.2.0", "react": "18.2.0",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"react-error-boundary": "^4.0.2", "react-error-boundary": "^4.0.2",