summaryrefslogtreecommitdiff
path: root/internal/db/bundb/notification.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db/bundb/notification.go')
-rw-r--r--internal/db/bundb/notification.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/db/bundb/notification.go b/internal/db/bundb/notification.go
index 5e825d096..034b3b8ec 100644
--- a/internal/db/bundb/notification.go
+++ b/internal/db/bundb/notification.go
@@ -108,3 +108,17 @@ func (n *notificationDB) GetNotifications(ctx context.Context, accountID string,
return notifs, nil
}
+
+func (n *notificationDB) ClearNotifications(ctx context.Context, accountID string) db.Error {
+ if _, err := n.conn.
+ NewDelete().
+ Table("notifications").
+ Where("target_account_id = ?", accountID).
+ Exec(ctx); err != nil {
+ return n.conn.ProcessError(err)
+ }
+
+ n.cache.Clear()
+
+ return nil
+}