storagenode/console/service: SatellitePayStubMonthly returns array of objects

Change-Id: I06d86087c81acd2eb3acd73c1997bab9734bae9e
This commit is contained in:
Qweder93 2020-04-20 16:03:42 +03:00 committed by Nikolai Siedov
parent 884638a294
commit 1af70703ef
2 changed files with 2 additions and 2 deletions

View File

@ -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
}

View File

@ -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() {