@@ -20,6 +20,8 @@ import (
2020
2121const defaultPageSize = 20
2222
23+ const msgTaskAssigned = "New task assigned to you"
24+
2325// NotificationSender is implemented by the notifications service.
2426// It is nilable - if nil, notification triggering is skipped.
2527type NotificationSender interface {
@@ -64,7 +66,7 @@ func (r *RequestsHandler) CreateRequest(c *fiber.Ctx) error {
6466 }
6567
6668 if r .NotificationSender != nil && requestBody .UserID != nil {
67- if err := r .NotificationSender .Notify (c .Context (), * requestBody .UserID , models .TypeTaskAssigned , "New task assigned to you" , res .Name ); err != nil {
69+ if err := r .NotificationSender .Notify (c .Context (), * requestBody .UserID , models .TypeTaskAssigned , msgTaskAssigned , res .Name ); err != nil {
6870 slog .Error ("failed to send task assigned notification" , "err" , err )
6971 }
7072 }
@@ -246,7 +248,7 @@ func (r *RequestsHandler) GenerateRequest(c *fiber.Ctx) error {
246248 }
247249
248250 if r .NotificationSender != nil && req .UserID != nil {
249- if err := r .NotificationSender .Notify (c .Context (), * req .UserID , models .TypeTaskAssigned , "New task assigned to you" , res .Name ); err != nil {
251+ if err := r .NotificationSender .Notify (c .Context (), * req .UserID , models .TypeTaskAssigned , msgTaskAssigned , res .Name ); err != nil {
250252 slog .Error ("failed to send task assigned notification" , "err" , err )
251253 }
252254 }
0 commit comments