1
0

Add crud endpoints for notifications (#801)

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/api/pulls/801
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
This commit is contained in:
konrad
2021-02-21 14:50:34 +00:00
parent 509f23c550
commit 2178166ece
19 changed files with 842 additions and 66 deletions

View File

@ -40,6 +40,6 @@ func (s *IncreaseUserCounter) Name() string {
}
// Hanlde is executed when the event IncreaseUserCounter listens on is fired
func (s *IncreaseUserCounter) Handle(payload message.Payload) (err error) {
func (s *IncreaseUserCounter) Handle(msg *message.Message) (err error) {
return keyvalue.IncrBy(metrics.UserCountKey, 1)
}

View File

@ -54,6 +54,11 @@ func (n *EmailConfirmNotification) ToDB() interface{} {
return nil
}
// Name returns the name of the notification
func (n *EmailConfirmNotification) Name() string {
return ""
}
// PasswordChangedNotification represents a PasswordChangedNotification notification
type PasswordChangedNotification struct {
User *User
@ -73,6 +78,11 @@ func (n *PasswordChangedNotification) ToDB() interface{} {
return nil
}
// Name returns the name of the notification
func (n *PasswordChangedNotification) Name() string {
return ""
}
// ResetPasswordNotification represents a ResetPasswordNotification notification
type ResetPasswordNotification struct {
User *User
@ -92,3 +102,8 @@ func (n *ResetPasswordNotification) ToMail() *notifications.Mail {
func (n *ResetPasswordNotification) ToDB() interface{} {
return nil
}
// Name returns the name of the notification
func (n *ResetPasswordNotification) Name() string {
return ""
}