feat: use template modal

This commit is contained in:
Jason Song
2023-01-10 18:30:18 +08:00
parent 39a5e72c3c
commit 409f11cb73
4 changed files with 25 additions and 33 deletions

View File

@ -236,9 +236,12 @@ func UpdateRunner(ctx context.Context, r *ActionRunner, cols ...string) error {
}
// DeleteRunner deletes a runner by given ID.
func DeleteRunner(ctx context.Context, r *ActionRunner) error {
e := db.GetEngine(ctx)
_, err := e.Delete(r)
func DeleteRunner(ctx context.Context, id int64) error {
if _, err := GetRunnerByID(ctx, id); err != nil {
return err
}
_, err := db.GetEngine(ctx).Delete(&ActionRunner{ID: id})
return err
}