From cf274f1fd8c3a5b0c5fe5f2c355b12b34c9296f6 Mon Sep 17 00:00:00 2001 From: walker-16 Date: Fri, 20 Jan 2023 13:38:40 -0300 Subject: [PATCH] Fix counter int to string heartbeats endpoint (#70) --- api/handlers/heartbeats/controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/handlers/heartbeats/controller.go b/api/handlers/heartbeats/controller.go index a9ed572d..54dec424 100644 --- a/api/handlers/heartbeats/controller.go +++ b/api/handlers/heartbeats/controller.go @@ -36,7 +36,7 @@ type HeartbeatResponse struct { type RawHeartbeat struct { NodeName string `json:"nodeName"` - Counter int64 `json:"counter"` + Counter string `json:"counter"` Timestamp string `json:"timestamp"` Networks []*HeartbeatNetworkResponse `json:"networks"` Version string `json:"version"` @@ -105,7 +105,7 @@ func buildHeartbeatResponse(heartbeats []*HeartbeatDoc) *HeartbeatsResponse { P2PNodeAddr: "", // not exists in heartbeats mongo collection. RawHeartbeat: &RawHeartbeat{ NodeName: heartbeat.NodeName, - Counter: heartbeat.Counter, + Counter: strconv.Itoa(int(heartbeat.Counter)), Timestamp: strconv.Itoa(int(heartbeat.Timestamp)), Networks: networkResponses, Version: heartbeat.Version,