From 8035403416f98115bf743bcd537d77c657917e71 Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Sun, 20 Feb 2022 16:51:48 +0000 Subject: [PATCH] Use camelCase for json identifiers --- server/transaction.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/transaction.go b/server/transaction.go index 432d5ad..c11afdb 100644 --- a/server/transaction.go +++ b/server/transaction.go @@ -22,8 +22,8 @@ type NewTransactionPayload struct { } `json:"category"` Memo string `json:"memo"` Amount string `json:"amount"` - BudgetID uuid.UUID `json:"budget_id"` - AccountID uuid.UUID `json:"account_id"` + BudgetID uuid.UUID `json:"budgetId"` + AccountID uuid.UUID `json:"accountId"` State string `json:"state"` } @@ -49,14 +49,14 @@ func (h *Handler) newTransaction(c *gin.Context) { return }*/ - //if !transactionUUID.Valid { + // if !transactionUUID.Valid { new := postgres.CreateTransactionParams{ Memo: payload.Memo, Date: time.Time(payload.Date), Amount: amount, AccountID: payload.AccountID, - PayeeID: payload.Payee.ID, //TODO handle new payee - CategoryID: payload.Category.ID, //TODO handle new category + PayeeID: payload.Payee.ID, // TODO handle new payee + CategoryID: payload.Category.ID, // TODO handle new category Status: postgres.TransactionStatus(payload.State), } _, err = h.Service.CreateTransaction(c.Request.Context(), new)