chore: Add updateUserPasswordLoggedInOnly endpoint for self-hosted instances

This commit is contained in:
Mo Tarbin 2024-11-17 14:30:34 -05:00
parent 5320b4e980
commit 6dc8092ff4
2 changed files with 63 additions and 9 deletions

View file

@ -162,3 +162,7 @@ func (r *UserRepository) DeleteAPIToken(c context.Context, userID int, tokenID s
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
}
func (r *UserRepository) UpdatePasswordByUserId(c context.Context, userID int, password string) error {
return r.db.WithContext(c).Model(&uModel.User{}).Where("id = ?", userID).Update("password", password).Error
}