@@ -59,13 +59,9 @@ func GetRunners(ctx *context.APIContext, ownerID, repoID int64) {
5959}
6060
6161func GetRunner (ctx * context.APIContext , ownerID , repoID , runnerID int64 ) {
62- runner , exists , err := db . GetByID [ actions_model.ActionRunner ] (ctx , runnerID )
62+ runner , err := actions_model .GetRunnerByID (ctx , runnerID )
6363 if err != nil {
64- ctx .APIErrorInternal (err )
65- return
66- }
67- if ! exists {
68- ctx .APIErrorNotFound ("Runner does not exist" )
64+ ctx .APIErrorNotFound (err )
6965 return
7066 }
7167 if ! runner .Editable (ownerID , repoID ) {
@@ -76,15 +72,11 @@ func GetRunner(ctx *context.APIContext, ownerID, repoID, runnerID int64) {
7672}
7773
7874func DeleteRunner (ctx * context.APIContext , ownerID , repoID , runnerID int64 ) {
79- runner , exists , err := db . GetByID [ actions_model.ActionRunner ] (ctx , runnerID )
75+ runner , err := actions_model .GetRunnerByID (ctx , runnerID )
8076 if err != nil {
8177 ctx .APIErrorInternal (err )
8278 return
8379 }
84- if ! exists {
85- ctx .APIErrorNotFound ("Runner does not exist" )
86- return
87- }
8880 if ! runner .Editable (ownerID , repoID ) {
8981 ctx .APIErrorNotFound ("No permission to delete this runner" )
9082 return
0 commit comments