feat: image full URI in avatar

This commit is contained in:
2025-06-06 12:12:03 +02:00
parent 83e3e5a2e9
commit 9319564dea

View File

@ -170,8 +170,10 @@ func (h *UserHandler) uploadAvatar(w http.ResponseWriter, r *http.Request) {
return
}
imgURI := fmt.Sprintf("%s/api/v1/avatar/%s", h.cfg.Uri, uploadInfo.Key)
if err := h.repo.UpdateProfilePicture(r.Context(), repository.UpdateProfilePictureParams{
ProfilePicture: &uploadInfo.Key,
ProfilePicture: &imgURI,
ID: user.ID,
}); err != nil {
web.Error(w, "failed to update profile picture", http.StatusInternalServerError)