fix: type mismatch in removeChat function (#188)

This commit is contained in:
shadcn 2024-02-15 10:46:52 +04:00 committed by GitHub
commit 69ca8fcc22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,7 +49,8 @@ export async function removeChat({ id, path }: { id: string; path: string }) {
}
}
const uid = await kv.hget<string>(`chat:${id}`, 'userId')
//Convert uid to string for consistent comparison with session.user.id
const uid = String(await kv.hget(`chat:${id}`, 'userId'))
if (uid !== session?.user?.id) {
return {