Skip to content

Commit

Permalink
Merge pull request #145 from numary/fix/post-transaction
Browse files Browse the repository at this point in the history
fix/post transaction
  • Loading branch information
gfyrag authored Feb 1, 2022
2 parents b85bc61 + 7d60eec commit 3cf55db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/api/controllers/transaction_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (ctl *TransactionController) PostTransaction(c *gin.Context) {
}
return
}
ctl.response(c, http.StatusOK, result[0])
ctl.response(c, http.StatusOK, result)
}

// GetTransaction godoc
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/controllers/transaction_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ func TestPostTransactionMetadata(t *testing.T) {
},
})
assert.Equal(t, http.StatusOK, rsp.Result().StatusCode)
tx := core.Transaction{}
tx := make([]core.Transaction, 0)
internal.DecodeSingleResponse(t, rsp.Body, &tx)

rsp = internal.PostTransactionMetadata(t, api, tx.ID, core.Metadata{
rsp = internal.PostTransactionMetadata(t, api, tx[0].ID, core.Metadata{
"foo": json.RawMessage(`"bar"`),
})
assert.Equal(t, http.StatusNoContent, rsp.Result().StatusCode)
Expand Down

0 comments on commit 3cf55db

Please sign in to comment.