Skip to content

Commit

Permalink
Fix incorrect bind call
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmacdonald committed Sep 19, 2023
1 parent bb0752a commit 937a7e6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/app/http_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down

0 comments on commit 937a7e6

Please sign in to comment.