diff --git a/internal/app/http_api.go b/internal/app/http_api.go index c0391a6e..d296ebbb 100644 --- a/internal/app/http_api.go +++ b/internal/app/http_api.go @@ -1241,7 +1241,9 @@ func onAPIProfile(app *App) gin.HandlerFunc { defer cancelRequest() var req profileQuery - if !bind(ctx, log, &req) { + if errBind := ctx.Bind(&req); errBind != nil { + responseErr(ctx, http.StatusBadRequest, nil) + return } @@ -1256,6 +1258,8 @@ func onAPIProfile(app *App) gin.HandlerFunc { if errGetProfile := app.PersonBySID(requestCtx, sid, &person); errGetProfile != nil { responseErr(ctx, http.StatusInternalServerError, consts.ErrInternal) + log.Error("Failed to create new profile", zap.Error(errGetProfile)) + return }