Fix types
This commit is contained in:
parent
f3e846955f
commit
5de9ae612d
2 changed files with 2 additions and 2 deletions
|
|
@ -40,7 +40,7 @@ export async function POST(req: Request) {
|
||||||
const stream = OpenAIStream(res, {
|
const stream = OpenAIStream(res, {
|
||||||
async onCompletion(completion) {
|
async onCompletion(completion) {
|
||||||
const title = json.messages[0].content.substring(0, 100)
|
const title = json.messages[0].content.substring(0, 100)
|
||||||
const userId = session.user.id
|
const userId = session.user?.id
|
||||||
const id = json.id ?? nanoid()
|
const id = json.id ?? nanoid()
|
||||||
const createdAt = Date.now()
|
const createdAt = Date.now()
|
||||||
const path = `/chat/${id}`
|
const path = `/chat/${id}`
|
||||||
|
|
|
||||||
2
index.d.ts → next-auth.d.ts
vendored
2
index.d.ts → next-auth.d.ts
vendored
|
|
@ -7,7 +7,7 @@ declare module 'next-auth' {
|
||||||
interface Session {
|
interface Session {
|
||||||
user: {
|
user: {
|
||||||
/** The user's postal address. */
|
/** The user's postal address. */
|
||||||
address: string
|
id: string
|
||||||
} & DefaultSession['user']
|
} & DefaultSession['user']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue