small fixes - but it works
This commit is contained in:
@@ -133,7 +133,7 @@ func (exp *Expense) Insert() error {
|
|||||||
// TODO
|
// TODO
|
||||||
// Add a transaction here so that it fails when necessary
|
// Add a transaction here so that it fails when necessary
|
||||||
res, err := db.Exec(query, exp.Description, exp.Value, exp.ExpStore.StoreID,
|
res, err := db.Exec(query, exp.Description, exp.Value, exp.ExpStore.StoreID,
|
||||||
exp.ExpCategory.CategoryID, exp.ExpType.TypeID, 0, exp.ExpDate,
|
exp.ExpCategory.CategoryID, exp.ExpType.TypeID, 1, exp.ExpDate,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import (
|
|||||||
"expenses/expenses"
|
"expenses/expenses"
|
||||||
"expenses/templating"
|
"expenses/templating"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -223,7 +222,6 @@ func updateExpense(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
newExp.ExpID = expenseID
|
newExp.ExpID = expenseID
|
||||||
log.Println(newExp)
|
|
||||||
|
|
||||||
err = newExp.Update()
|
err = newExp.Update()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user