Accept a Category instead of just a name string.
This commit is contained in:
parent
2fb6176b50
commit
561425b739
@ -237,14 +237,14 @@ func (s *SQLiteMindflow) Categories() (categories []mindflow.Category, err error
|
||||
return categories, nil
|
||||
}
|
||||
|
||||
func (s *SQLiteMindflow) NewCategory(name string) (int64, error) {
|
||||
func (s *SQLiteMindflow) NewCategory(category *mindflow.Category) (int64, error) {
|
||||
tx, err := s.db.Begin()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
defer tx.Rollback()
|
||||
|
||||
r, err := tx.Stmt(stmtCategoryNew).Exec(name)
|
||||
r, err := tx.Stmt(stmtCategoryNew).Exec(category.Name)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user