summaryrefslogtreecommitdiff
path: root/internal/api/client/admin/ruledelete.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/client/admin/ruledelete.go')
-rw-r--r--internal/api/client/admin/ruledelete.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/internal/api/client/admin/ruledelete.go b/internal/api/client/admin/ruledelete.go
index ead219e34..7e8fc0037 100644
--- a/internal/api/client/admin/ruledelete.go
+++ b/internal/api/client/admin/ruledelete.go
@@ -18,7 +18,6 @@
package admin
import (
- "errors"
"fmt"
"net/http"
@@ -95,10 +94,9 @@ func (m *Module) RuleDELETEHandler(c *gin.Context) {
return
}
- ruleID := c.Param(IDKey)
- if ruleID == "" {
- err := errors.New("no rule id specified")
- apiutil.ErrorHandler(c, gtserror.NewErrorBadRequest(err, err.Error()), m.processor.InstanceGetV1)
+ ruleID, errWithCode := apiutil.ParseID(c.Param(apiutil.IDKey))
+ if errWithCode != nil {
+ apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
}