From a8c2e65bfb650a6b3f1cfb9e02670d349ad438f8 Mon Sep 17 00:00:00 2001 From: Sergey Yarkov Date: Tue, 1 Mar 2022 22:46:48 +0300 Subject: [PATCH] fix: fixed error on deleting notification --- app/Store/NotificationStore.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Store/NotificationStore.ts b/app/Store/NotificationStore.ts index 50e90e0..dd98e57 100644 --- a/app/Store/NotificationStore.ts +++ b/app/Store/NotificationStore.ts @@ -52,6 +52,8 @@ class RedisNotificationStore { } public async del(userId: string, keys: string[]): Promise { + if (keys.length === 0) return 0; + const k = keys.map(v => `notification:${v}`); const count = await this.redisClient.zrem(`user:${userId}`, k); await this.redisClient.del(k);