fix: scope notifications by tenant
This commit is contained in:
@@ -269,7 +269,8 @@ func (u *User) Following(ctx fiber.Ctx, user *models.User) ([]dto.TenantProfile,
|
||||
// @Bind typeArg query key(type)
|
||||
// @Bind page query
|
||||
func (u *User) Notifications(ctx fiber.Ctx, user *models.User, typeArg string, page int) (*requests.Pager, error) {
|
||||
return services.Notification.List(ctx, user.ID, page, typeArg)
|
||||
tenantID := getTenantID(ctx)
|
||||
return services.Notification.List(ctx, tenantID, user.ID, page, typeArg)
|
||||
}
|
||||
|
||||
// Mark notification as read
|
||||
@@ -284,7 +285,8 @@ func (u *User) Notifications(ctx fiber.Ctx, user *models.User, typeArg string, p
|
||||
// @Bind user local key(__ctx_user)
|
||||
// @Bind id path
|
||||
func (u *User) MarkNotificationRead(ctx fiber.Ctx, user *models.User, id int64) error {
|
||||
return services.Notification.MarkRead(ctx, user.ID, id)
|
||||
tenantID := getTenantID(ctx)
|
||||
return services.Notification.MarkRead(ctx, tenantID, user.ID, id)
|
||||
}
|
||||
|
||||
// Mark all notifications as read
|
||||
@@ -297,7 +299,8 @@ func (u *User) MarkNotificationRead(ctx fiber.Ctx, user *models.User, id int64)
|
||||
// @Success 200 {string} string "OK"
|
||||
// @Bind user local key(__ctx_user)
|
||||
func (u *User) MarkAllNotificationsRead(ctx fiber.Ctx, user *models.User) error {
|
||||
return services.Notification.MarkAllRead(ctx, user.ID)
|
||||
tenantID := getTenantID(ctx)
|
||||
return services.Notification.MarkAllRead(ctx, tenantID, user.ID)
|
||||
}
|
||||
|
||||
// List my coupons
|
||||
|
||||
Reference in New Issue
Block a user