Add ability to change is_open from API

This commit is contained in:
2022-03-02 21:15:56 +00:00
parent 4fb3c2a335
commit f26ee8f472
3 changed files with 15 additions and 5 deletions

View File

@ -39,6 +39,7 @@ type TransactionsResponse struct {
type EditAccountRequest struct {
Name string `json:"name"`
OnBudget bool `json:"onBudget"`
IsOpen bool `json:"isOpen"`
}
func (h *Handler) editAccount(c *gin.Context) {
@ -59,6 +60,7 @@ func (h *Handler) editAccount(c *gin.Context) {
updateParams := postgres.UpdateAccountParams{
Name: request.Name,
OnBudget: request.OnBudget,
IsOpen: request.IsOpen,
ID: accountUUID,
}
account, err := h.Service.UpdateAccount(c.Request.Context(), updateParams)