Fix query & add doc

This commit is contained in:
Neeraj Gupta
2025-04-25 17:26:59 +05:30
parent daf1d632e7
commit 8b02edb19f

View File

@@ -31,11 +31,12 @@ func (repo *NotificationHistoryRepository) SetLastNotificationTimeToNow(userID i
return stacktrace.Propagate(err, "")
}
// DeleteLastNotificationTime deletes the last notification time for a user and template.
// This will be used in the upcoming PR for resetting storage alerts notifications.
func (repo *NotificationHistoryRepository) DeleteLastNotificationTime(userID int64, templateID string) error {
_, err := repo.DB.Exec(`DELETE FROM notification_history WHERE user_id=$1 AND template_id='$2'`)
_, err := repo.DB.Exec(`DELETE FROM notification_history WHERE user_id=$1 AND template_id='$2'`, userID, templateID)
if err != nil {
return stacktrace.Propagate(err, "")
}
return nil
}