chore: mark as removed instead of delete history

This commit is contained in:
Simon Ding
2025-03-31 17:59:04 +08:00
parent c23666eabf
commit 3c9f6d0b23
6 changed files with 18 additions and 4 deletions

View File

@@ -499,7 +499,7 @@ func (c *Client) GetHistory(id int) *ent.History {
}
func (c *Client) DeleteHistory(id int) error {
_, err := c.ent.History.Delete().Where(history.ID(id)).Exec(context.Background())
err := c.ent.History.Update().Where(history.ID(id)).SetStatus(history.StatusRemoved).Exec(context.Background())
return err
}