Extract struct for return value of getTransactionsForAccount

This commit is contained in:
Jan Bader 2022-02-09 21:56:00 +00:00
parent 6cafaec422
commit 922041856f

View File

@ -28,8 +28,10 @@ func (h *Handler) transactionsForAccount(c *gin.Context) {
return return
} }
c.JSON(http.StatusOK, struct { c.JSON(http.StatusOK, TransactionsResponse{account, transactions})
}
type TransactionsResponse struct {
Account postgres.Account Account postgres.Account
Transactions []postgres.GetTransactionsForAccountRow Transactions []postgres.GetTransactionsForAccountRow
}{account, transactions})
} }