not allow to delete category when other transaction is using it

This commit is contained in:
MaysWind
2020-12-14 00:23:07 +08:00
parent d2c1dcbdbd
commit 99c628cc8a
5 changed files with 27 additions and 5 deletions
+1 -1
View File
@@ -299,7 +299,7 @@ func (a *TransactionCategoriesApi) CategoryDeleteHandler(c *core.Context) (inter
}
uid := c.GetCurrentUid()
err = a.categories.DeleteCategories(uid, []int64{categoryDeleteReq.Id})
err = a.categories.DeleteCategory(uid, categoryDeleteReq.Id)
if err != nil {
log.ErrorfWithRequestId(c, "[transaction_categories.CategoryDeleteHandler] failed to delete category \"id:%d\" for user \"uid:%d\", because %s", categoryDeleteReq.Id, uid, err.Error())