From 922041856f4c72fc008702c777d5ba5d28f7732b Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Wed, 9 Feb 2022 21:56:00 +0000 Subject: [PATCH] Extract struct for return value of getTransactionsForAccount --- http/account.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/http/account.go b/http/account.go index 93867a7..03296c2 100644 --- a/http/account.go +++ b/http/account.go @@ -28,8 +28,10 @@ func (h *Handler) transactionsForAccount(c *gin.Context) { return } - c.JSON(http.StatusOK, struct { - Account postgres.Account - Transactions []postgres.GetTransactionsForAccountRow - }{account, transactions}) + c.JSON(http.StatusOK, TransactionsResponse{account, transactions}) +} + +type TransactionsResponse struct { + Account postgres.Account + Transactions []postgres.GetTransactionsForAccountRow }