From 65ba53fbd6f51ffd152c2ddeb005cd034a16cd2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Woz=CC=81niak?= Date: Wed, 13 Sep 2023 15:16:03 +0200 Subject: [PATCH] Fixed payload parsing --- internal/controller/report.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/controller/report.go b/internal/controller/report.go index f20f13d..64076da 100644 --- a/internal/controller/report.go +++ b/internal/controller/report.go @@ -1,6 +1,7 @@ package controller import ( + "encoding/json" "github.com/labstack/echo/v4" "github.com/matisiekpl/pansa-plan/internal/model" "github.com/matisiekpl/pansa-plan/internal/service" @@ -17,7 +18,7 @@ type reportController struct { func (r reportController) Generate(c echo.Context) error { var plan model.Plan - err := c.Bind(&plan) + err := json.Unmarshal([]byte(c.QueryParam("payload")), &plan) if err != nil { return err }