1
0
Fork 0

Accept a Category instead of just a name string.

This commit is contained in:
Alexander Andreev 2023-05-23 02:46:22 +04:00
parent 2fb6176b50
commit 561425b739
Signed by: Arav
GPG Key ID: D22A817D95815393
1 changed files with 2 additions and 2 deletions

View File

@ -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
}