Remove blurHash references from User model and related components

This commit is contained in:
Leon Bösche
2026-01-28 23:59:15 +01:00
parent de26b280d0
commit f4f80b9ed7
6 changed files with 15 additions and 57 deletions

View File

@@ -3801,15 +3801,14 @@ func getUserProfileHandler(w http.ResponseWriter, r *http.Request, db *database.
Email string `json:"email"`
DisplayName *string `json:"displayName"`
AvatarURL *string `json:"avatarUrl"`
BlurHash *string `json:"blurHash"`
CreatedAt time.Time `json:"createdAt"`
LastLoginAt *time.Time `json:"lastLoginAt"`
}
err = db.QueryRowContext(r.Context(),
`SELECT id, username, email, display_name, avatar_url, blur_hash, created_at, last_login_at
`SELECT id, username, email, display_name, avatar_url, created_at, last_login_at
FROM users WHERE id = $1`, userID).
Scan(&user.ID, &user.Username, &user.Email, &user.DisplayName, &user.AvatarURL, &user.BlurHash, &user.CreatedAt, &user.LastLoginAt)
Scan(&user.ID, &user.Username, &user.Email, &user.DisplayName, &user.AvatarURL, &user.CreatedAt, &user.LastLoginAt)
if err != nil {
if err == sql.ErrNoRows {
errors.WriteError(w, errors.CodeNotFound, "User not found", http.StatusNotFound)
@@ -3842,7 +3841,6 @@ func updateUserProfileHandler(w http.ResponseWriter, r *http.Request, db *databa
DisplayName *string `json:"displayName"`
Email *string `json:"email"`
AvatarURL *string `json:"avatarUrl"`
BlurHash *string `json:"blurHash"`
}
if err = json.NewDecoder(r.Body).Decode(&req); err != nil {
@@ -3870,11 +3868,6 @@ func updateUserProfileHandler(w http.ResponseWriter, r *http.Request, db *databa
args = append(args, *req.AvatarURL)
argIndex++
}
if req.BlurHash != nil {
setParts = append(setParts, fmt.Sprintf("blur_hash = $%d", argIndex))
args = append(args, *req.BlurHash)
argIndex++
}
if len(setParts) == 0 {
// No fields to update
@@ -3905,9 +3898,6 @@ func updateUserProfileHandler(w http.ResponseWriter, r *http.Request, db *databa
if req.AvatarURL != nil {
metadata["avatarUrl"] = *req.AvatarURL
}
if req.BlurHash != nil {
metadata["blurHash"] = *req.BlurHash
}
auditLogger.Log(r.Context(), audit.Entry{
UserID: &userID,