From 9319564deac7a39c35340002d6c27592a5b3ac3d Mon Sep 17 00:00:00 2001 From: LandaMm Date: Fri, 6 Jun 2025 12:12:03 +0200 Subject: [PATCH] feat: image full URI in avatar --- internal/user/routes.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)