Use camelCase for json identifiers
This commit is contained in:
parent
1a1971246d
commit
8035403416
@ -22,8 +22,8 @@ type NewTransactionPayload struct {
|
|||||||
} `json:"category"`
|
} `json:"category"`
|
||||||
Memo string `json:"memo"`
|
Memo string `json:"memo"`
|
||||||
Amount string `json:"amount"`
|
Amount string `json:"amount"`
|
||||||
BudgetID uuid.UUID `json:"budget_id"`
|
BudgetID uuid.UUID `json:"budgetId"`
|
||||||
AccountID uuid.UUID `json:"account_id"`
|
AccountID uuid.UUID `json:"accountId"`
|
||||||
State string `json:"state"`
|
State string `json:"state"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,14 +49,14 @@ func (h *Handler) newTransaction(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
//if !transactionUUID.Valid {
|
// if !transactionUUID.Valid {
|
||||||
new := postgres.CreateTransactionParams{
|
new := postgres.CreateTransactionParams{
|
||||||
Memo: payload.Memo,
|
Memo: payload.Memo,
|
||||||
Date: time.Time(payload.Date),
|
Date: time.Time(payload.Date),
|
||||||
Amount: amount,
|
Amount: amount,
|
||||||
AccountID: payload.AccountID,
|
AccountID: payload.AccountID,
|
||||||
PayeeID: payload.Payee.ID, //TODO handle new payee
|
PayeeID: payload.Payee.ID, // TODO handle new payee
|
||||||
CategoryID: payload.Category.ID, //TODO handle new category
|
CategoryID: payload.Category.ID, // TODO handle new category
|
||||||
Status: postgres.TransactionStatus(payload.State),
|
Status: postgres.TransactionStatus(payload.State),
|
||||||
}
|
}
|
||||||
_, err = h.Service.CreateTransaction(c.Request.Context(), new)
|
_, err = h.Service.CreateTransaction(c.Request.Context(), new)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user