From 0146dd4a161a051e9d9d59cc6c988208c55c0a4e Mon Sep 17 00:00:00 2001 From: ianmuchyri Date: Tue, 5 Mar 2024 17:48:49 +0300 Subject: [PATCH] update content type to json Signed-off-by: ianmuchyri --- ui/api/endpoint.go | 5 +++-- ui/service.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/api/endpoint.go b/ui/api/endpoint.go index 939c8b08..de004300 100644 --- a/ui/api/endpoint.go +++ b/ui/api/endpoint.go @@ -1307,8 +1307,9 @@ func FetchChartDataEndpoint(svc ui.Service) endpoint.Endpoint { } return uiRes{ - code: http.StatusOK, - html: res, + code: http.StatusOK, + html: res, + headers: map[string]string{"Content-Type": jsonContentType}, }, nil } } diff --git a/ui/service.go b/ui/service.go index f5f9737a..d8af8e5f 100644 --- a/ui/service.go +++ b/ui/service.go @@ -1836,7 +1836,7 @@ func (us *uiService) FetchChartData(token string, channelID string, mpgm sdk.Mes return []byte{}, err } - data, jsonErr := json.Marshal(msg.Messages) + data, jsonErr := json.Marshal(msg) if jsonErr != nil { return []byte{}, errors.Wrap(err, ErrExecTemplate) }