From a48e20ac1faf9aa9cee89f1c8d6e4c75344c083c Mon Sep 17 00:00:00 2001 From: ErrorSyntax1 Date: Mon, 1 Jul 2024 11:59:16 +0900 Subject: [PATCH] =?UTF-8?q?fix:EditResponse=E3=81=A7=E6=9C=80=E5=BE=8C?= =?UTF-8?q?=E3=81=AE=E8=B3=AA=E5=95=8F=E3=81=AE=E7=AF=84=E5=9B=B2=E3=81=8C?= =?UTF-8?q?=E9=81=A9=E7=94=A8=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=81=9F?= =?UTF-8?q?=E3=81=93=E3=81=A8=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- router/responses.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/router/responses.go b/router/responses.go index 81d11d64..fde97cfd 100644 --- a/router/responses.go +++ b/router/responses.go @@ -323,9 +323,9 @@ func (r *Response) EditResponse(c echo.Context) error { c.Logger().Errorf("failed to get scale labels: %+v", err) return echo.NewHTTPError(http.StatusInternalServerError, err) } - scaleLabelMap := make(map[int]*model.ScaleLabels, len(scaleLabels)) + scaleLabelMap := make(map[int]model.ScaleLabels, len(scaleLabels)) for _, label := range scaleLabels { - scaleLabelMap[label.QuestionID] = &label + scaleLabelMap[label.QuestionID] = label } // LinearScaleのパターンマッチ @@ -334,9 +334,9 @@ func (r *Response) EditResponse(c echo.Context) error { case "LinearScale": label, ok := scaleLabelMap[body.QuestionID] if !ok { - label = &model.ScaleLabels{} + label = model.ScaleLabels{} } - if err := r.CheckScaleLabel(*label, body.Body.ValueOrZero()); err != nil { + if err := r.CheckScaleLabel(label, body.Body.ValueOrZero()); err != nil { c.Logger().Infof("invalid scale label: %+v", err) return echo.NewHTTPError(http.StatusBadRequest, err) }