clearChats (#62)

This commit is contained in:
Jared Palmer 2023-06-20 20:26:59 -04:00 committed by GitHub
commit cfd367baf9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,7 +74,9 @@ export async function clearChats() {
} }
const chats: string[] = await kv.zrange(`user:chat:${session.user.id}`, 0, -1) const chats: string[] = await kv.zrange(`user:chat:${session.user.id}`, 0, -1)
if (!chats.length) {
return redirect('/')
}
const pipeline = kv.pipeline() const pipeline = kv.pipeline()
for (const chat of chats) { for (const chat of chats) {