fix: use reverse sort for chats
This commit is contained in:
parent
a3c8f93de8
commit
2231c436cc
1 changed files with 3 additions and 1 deletions
|
|
@ -13,7 +13,9 @@ export async function getChats(userId?: string | null) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const pipeline = kv.pipeline()
|
const pipeline = kv.pipeline()
|
||||||
const chats: string[] = await kv.zrange(`user:chat:${userId}`, 0, -1)
|
const chats: string[] = await kv.zrange(`user:chat:${userId}`, 0, -1, {
|
||||||
|
rev: true
|
||||||
|
})
|
||||||
|
|
||||||
for (const chat of chats) {
|
for (const chat of chats) {
|
||||||
pipeline.hgetall(chat)
|
pipeline.hgetall(chat)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue