From 1af70703ef533337e28ec2681c145a93b527614f Mon Sep 17 00:00:00 2001 From: Qweder93 Date: Mon, 20 Apr 2020 16:03:42 +0300 Subject: [PATCH] storagenode/console/service: SatellitePayStubMonthly returns array of objects Change-Id: I06d86087c81acd2eb3acd73c1997bab9734bae9e --- storagenode/console/consoleapi/heldamount.go | 2 +- storagenode/console/consoleapi/heldamount_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/storagenode/console/consoleapi/heldamount.go b/storagenode/console/consoleapi/heldamount.go index 65533b0f0..e5d29e257 100644 --- a/storagenode/console/consoleapi/heldamount.go +++ b/storagenode/console/consoleapi/heldamount.go @@ -80,7 +80,7 @@ func (heldAmount *HeldAmount) PayStubMonthly(w http.ResponseWriter, r *http.Requ return } - if err := json.NewEncoder(w).Encode(payStub); err != nil { + if err := json.NewEncoder(w).Encode([]*heldamount.PayStub{payStub}); err != nil { heldAmount.log.Error("failed to encode json response", zap.Error(ErrHeldAmountAPI.Wrap(err))) return } diff --git a/storagenode/console/consoleapi/heldamount_test.go b/storagenode/console/consoleapi/heldamount_test.go index 97a32426e..695988124 100644 --- a/storagenode/console/consoleapi/heldamount_test.go +++ b/storagenode/console/consoleapi/heldamount_test.go @@ -67,7 +67,7 @@ func TestHeldAmountApi(t *testing.T) { require.NotNil(t, res) require.Equal(t, http.StatusOK, res.StatusCode) - expected, err := json.Marshal(paystub) + expected, err := json.Marshal([]heldamount.PayStub{paystub}) require.NoError(t, err) defer func() {