diff options
Diffstat (limited to 'models/actions')
-rw-r--r-- | models/actions/artifact.go | 13 | ||||
-rw-r--r-- | models/actions/runner.go | 2 |
2 files changed, 1 insertions, 14 deletions
diff --git a/models/actions/artifact.go b/models/actions/artifact.go index 42bd9c23cb..5390f6288f 100644 --- a/models/actions/artifact.go +++ b/models/actions/artifact.go @@ -90,19 +90,6 @@ func getArtifactByNameAndPath(ctx context.Context, runID int64, name, fpath stri return &art, nil } -// GetArtifactByID returns an artifact by id -func GetArtifactByID(ctx context.Context, id int64) (*ActionArtifact, error) { - var art ActionArtifact - has, err := db.GetEngine(ctx).ID(id).Get(&art) - if err != nil { - return nil, err - } else if !has { - return nil, util.ErrNotExist - } - - return &art, nil -} - // UpdateArtifactByID updates an artifact by id func UpdateArtifactByID(ctx context.Context, id int64, art *ActionArtifact) error { art.ID = id diff --git a/models/actions/runner.go b/models/actions/runner.go index 5630741550..4103ba4477 100644 --- a/models/actions/runner.go +++ b/models/actions/runner.go @@ -254,7 +254,7 @@ func DeleteRunner(ctx context.Context, id int64) error { return err } - _, err := db.GetEngine(ctx).Delete(&ActionRunner{ID: id}) + _, err := db.DeleteByID[ActionRunner](ctx, id) return err } |