fix: return when failed to manage pvc

This commit is contained in:
starryskymeow
2025-07-17 18:55:34 +08:00
parent 9aa8b56922
commit d175a66394

View File

@@ -22,6 +22,7 @@ func (h *Handler) createPvc(c *gin.Context) {
err := k8s.CreatePvc(req, h.clientset)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"success": false, "message": err.Error()})
return
}
c.JSON(http.StatusAccepted, gin.H{"success": true})
}
@@ -31,6 +32,7 @@ func (h *Handler) deletePvc(c *gin.Context) {
err := k8s.DeletePvc(ID, h.clientset)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"success": false, "message": err.Error()})
return
}
c.JSON(http.StatusAccepted, gin.H{"success": true})
}