From 913b7ca13899c964973420422883c1defdb0ae12 Mon Sep 17 00:00:00 2001 From: Garritt McCune Date: Thu, 9 Sep 2021 15:04:23 -0500 Subject: [PATCH] Fixed a bug where the transaction would roll back if no subcategories where present. --- category.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/category.go b/category.go index 9e8b57c..81bd25b 100644 --- a/category.go +++ b/category.go @@ -84,6 +84,8 @@ func insertNewCategory(name string, subcategories []Subcategory) (recordID int64 } if len(subcategories) == 0 { + transaction.Commit() + return recordID, true }