Add Transaction to list after saving
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful

This commit is contained in:
2022-02-15 09:13:14 +00:00
parent b3ff5cf055
commit 8fbdd78cb3
4 changed files with 29 additions and 22 deletions

View File

@ -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")