From c629fa10ac9622f4cdaec2ca3e4b350f2ccd2a96 Mon Sep 17 00:00:00 2001 From: Leigh MacDonald Date: Mon, 18 Sep 2023 19:42:29 -0600 Subject: [PATCH] Fix incorrect bind call --- internal/app/http_api.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 }