fix: type overriding

This commit is contained in:
2025-06-04 12:33:22 +02:00
parent c27d837ab0
commit 849b5935c2
5 changed files with 16 additions and 27 deletions

View File

@ -19,7 +19,6 @@ import (
"gitea.local/admin/hspguard/internal/web"
"github.com/go-chi/chi/v5"
"github.com/google/uuid"
"github.com/jackc/pgx/v5/pgtype"
"github.com/minio/minio-go/v7"
)
@ -170,11 +169,8 @@ func (h *UserHandler) uploadAvatar(w http.ResponseWriter, r *http.Request) {
}
if err := h.repo.UpdateProfilePicture(r.Context(), repository.UpdateProfilePictureParams{
ProfilePicture: pgtype.Text{
String: uploadInfo.Key,
Valid: true,
},
ID: user.ID,
ProfilePicture: &uploadInfo.Key,
ID: user.ID,
}); err != nil {
web.Error(w, "failed to update profile picture", http.StatusInternalServerError)
return