fix: fixed error on deleting notification

This commit is contained in:
Sergey Yarkov 2022-03-01 22:46:48 +03:00
parent 97ed27a50a
commit a8c2e65bfb

View File

@ -52,6 +52,8 @@ class RedisNotificationStore {
} }
public async del(userId: string, keys: string[]): Promise<number> { public async del(userId: string, keys: string[]): Promise<number> {
if (keys.length === 0) return 0;
const k = keys.map(v => `notification:${v}`); const k = keys.map(v => `notification:${v}`);
const count = await this.redisClient.zrem(`user:${userId}`, k); const count = await this.redisClient.zrem(`user:${userId}`, k);
await this.redisClient.del(k); await this.redisClient.del(k);