feat: remove authentication requirement for avatar and image upload endpoints;

fix: remove 500 error responses from upload endpoints;
fix: return validation error strings instead of error lists;
fix: handle invalid avatar upload IDs with 400 Bad Request response;
fix: add missing S3Controller to controller initialization;
fix: change avatar_upload_id to string type and update validation rules;
chore: add license header to smtp.go;
refactor: replace manual proxy implementation with httputil.ReverseProxy;
fix: inject S3Service dependency into ProfileService;
fix: set color and color_grad fields during profile update;
fix: correct DTO mapping for profile and settings;
fix: check object existence before copying in SaveUpload;
fix: adjust profile DTO mapping function for proper pointer handling
This commit is contained in:
2025-08-02 03:47:56 +03:00
parent 669349e020
commit 5ed75c350a
14 changed files with 120 additions and 119 deletions

View File

@@ -28,7 +28,6 @@ import (
"path/filepath"
"github.com/gin-gonic/gin"
"github.com/go-playground/validator/v10"
"github.com/google/uuid"
"go.uber.org/zap"
)
@@ -127,10 +126,9 @@ func GetRequest[ModelT any](c *gin.Context) (*dto.Request[ModelT], error) {
validate := validation.NewValidator()
if err := validate.Struct(body); err != nil {
errorList := err.(validator.ValidationErrors)
c.AbortWithStatusJSON(
http.StatusBadRequest,
gin.H{"error": errorList})
gin.H{"error": err.Error()})
return nil, err
}