feat: default steps are read only
Server Deploy / deploy (push) Successful in 1m46s

This commit is contained in:
2026-07-28 13:34:08 +01:00
parent 26567766a9
commit 31e0000306
7 changed files with 80 additions and 23 deletions
+9
View File
@@ -1,6 +1,7 @@
package api
import (
"errors"
"fmt"
"io"
"net/http"
@@ -185,6 +186,10 @@ func updateStep(c *gin.Context) {
return
}
if err := services.UpdateStep(auth.InstanceID(c), c.Param("id"), s); err != nil {
if errors.Is(err, services.ErrDefaultStep) {
c.JSON(http.StatusConflict, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
@@ -194,6 +199,10 @@ func updateStep(c *gin.Context) {
func deleteStep(c *gin.Context) {
if err := services.DeleteStep(auth.InstanceID(c), c.Param("id")); err != nil {
if errors.Is(err, services.ErrDefaultStep) {
c.JSON(http.StatusConflict, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}