From 7b461ce9854b29e9ef686c326708cfa0903fd3be Mon Sep 17 00:00:00 2001 From: qowevisa Date: Sat, 16 Nov 2024 20:30:47 +0200 Subject: [PATCH] Fix expense error in AfterDelete hook --- db/expense.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/db/expense.go b/db/expense.go index b8582ae..5ea3184 100644 --- a/db/expense.go +++ b/db/expense.go @@ -125,9 +125,6 @@ func (e *Expense) AfterDelete(tx *gorm.DB) (err error) { if card.UserID != e.UserID { return ERROR_EXPENSE_INVALID_USERID } - if card.Balance < e.Value { - return ERROR_EXPENSE_CARD_INSUFFICIENT_BALANCE - } card.Balance += e.Value if err := tx.Save(card).Error; err != nil { return err