fix(notify): per-recipient timeout and return user on email removal

- Use per-recipient context timeout in sendEmails to prevent later
  recipients from failing due to shared timeout exhaustion
- Return updated user object from RemoveNotifyEmail handler for
  frontend state consistency (matching VerifyNotifyEmail pattern)
This commit is contained in:
erio
2026-04-12 12:50:27 +08:00
parent c3812ce1e3
commit 30b926add4
2 changed files with 10 additions and 3 deletions

View File

@@ -205,5 +205,12 @@ func (h *UserHandler) RemoveNotifyEmail(c *gin.Context) {
return
}
response.Success(c, gin.H{"message": "Email removed successfully"})
// Return updated user
updatedUser, err := h.userService.GetByID(c.Request.Context(), subject.UserID)
if err != nil {
response.ErrorFrom(c, err)
return
}
response.Success(c, dto.UserFromService(updatedUser))
}