[feature] Implemented notification clear (#720)

* Implemented notification clear

* Added the cache clear mechanism

* added multi user check test
This commit is contained in:
Artémis
2022-08-01 11:13:49 +02:00
committed by GitHub
parent 8fdc9ed552
commit 4fdbef04b4
7 changed files with 109 additions and 1 deletions

View File

@ -58,3 +58,12 @@ func (p *processor) NotificationsGet(ctx context.Context, authed *oauth.Auth, li
Limit: limit,
})
}
func (p *processor) NotificationsClear(ctx context.Context, authed *oauth.Auth) gtserror.WithCode {
err := p.db.ClearNotifications(ctx, authed.Account.ID)
if err != nil {
return gtserror.NewErrorInternalError(err)
}
return nil
}