aboutsummaryrefslogtreecommitdiffstats
path: root/internal/user/repo
diff options
context:
space:
mode:
Diffstat (limited to 'internal/user/repo')
-rw-r--r--internal/user/repo/repository.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/user/repo/repository.go b/internal/user/repo/repository.go
index 76ddd54..7dde6fb 100644
--- a/internal/user/repo/repository.go
+++ b/internal/user/repo/repository.go
@@ -158,3 +158,7 @@ func (r *UserRepository) GetAllUserTokens(c context.Context, userID int) ([]*uMo
func (r *UserRepository) DeleteAPIToken(c context.Context, userID int, tokenID string) error {
return r.db.WithContext(c).Where("id = ? AND user_id = ?", tokenID, userID).Delete(&uModel.APIToken{}).Error
}
+
+func (r *UserRepository) UpdateNotificationTarget(c context.Context, userID int, targetID string, targetType uModel.UserNotificationType) error {
+ return r.db.WithContext(c).Model(&uModel.UserNotificationTarget{}).Where("user_id = ? AND type = ?", userID, targetType).Update("target_id", targetID).Error
+}