diff --git a/http/transaction.go b/http/transaction.go index c047e0d..bcf0618 100644 --- a/http/transaction.go +++ b/http/transaction.go @@ -71,12 +71,13 @@ func (h *Handler) newTransaction(c *gin.Context) { CategoryID: payload.Category.ID, //TODO handle new category Status: postgres.TransactionStatus(payload.State), } - _, err = h.Service.CreateTransaction(c.Request.Context(), new) + transaction, err := h.Service.CreateTransaction(c.Request.Context(), new) if err != nil { c.AbortWithError(http.StatusInternalServerError, fmt.Errorf("create transaction: %w", err)) + return } - return + c.JSON(http.StatusOK, transaction) // } /* _, delete := c.GetPostForm("delete") diff --git a/web/src/components/TransactionInputRow.vue b/web/src/components/TransactionInputRow.vue index 1724dc3..d493689 100644 --- a/web/src/components/TransactionInputRow.vue +++ b/web/src/components/TransactionInputRow.vue @@ -1,7 +1,7 @@ diff --git a/web/src/pages/Account.vue b/web/src/pages/Account.vue index d38b6b1..af169bf 100644 --- a/web/src/pages/Account.vue +++ b/web/src/pages/Account.vue @@ -1,6 +1,5 @@