refactored db code

This commit is contained in:
2026-02-09 22:14:38 +11:00
parent b89ee75ca7
commit a4b4f4f4af
7 changed files with 24 additions and 100 deletions

View File

@@ -32,14 +32,10 @@ func CreateAuditLog(ctx context.Context, tx bun.Tx, log *AuditLog) error {
if log == nil {
return errors.New("log cannot be nil")
}
_, err := tx.NewInsert().
Model(log).
Exec(ctx)
err := Insert(tx, log).Exec(ctx)
if err != nil {
return errors.Wrap(err, "tx.NewInsert")
return errors.Wrap(err, "db.Insert")
}
return nil
}