mirror of
https://github.com/sergeyyarkov/educt-server.git
synced 2026-10-11 18:29:15 +03:00
fix: fixed error on deleting notification
This commit is contained in:
parent
97ed27a50a
commit
a8c2e65bfb
@ -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);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user