Fixed the delete button on the shares table of the expenses page

This commit is contained in:
2025-08-12 12:19:19 +01:00
parent a977f98586
commit ceea5344ce
9 changed files with 95 additions and 2 deletions
+19
View File
@@ -45,3 +45,22 @@ func ParseFormShares(userIDs []string, shares []string, sharesIDs []string,
return shareList, nil
}
func (s *Service) DeleteShare(id int64) error {
tx, err := s.DB.Begin()
if err != nil {
return err
}
defer tx.Rollback()
share := mod.ExpenseShare{
ExpShareID: id,
}
err = share.Delete(tx)
if err != nil {
return err
}
return tx.Commit()
}