diff --git a/internal/user/routes.go b/internal/user/routes.go index 42cabcf..270a286 100644 --- a/internal/user/routes.go +++ b/internal/user/routes.go @@ -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)