|
@@ -84,12 +84,12 @@ func DeleteStorage(c *gin.Context) {
|
|
|
c.ShouldBind(&json)
|
|
|
mountPoint := json["mount_point"]
|
|
|
if mountPoint == "" {
|
|
|
- c.JSON(common_err.SUCCESS, model.Result{Success: common_err.CLIENT_ERROR, Message: common_err.GetMsg(common_err.CLIENT_ERROR), Data: "mount_point is empty"})
|
|
|
+ c.JSON(common_err.CLIENT_ERROR, model.Result{Success: common_err.CLIENT_ERROR, Message: common_err.GetMsg(common_err.CLIENT_ERROR), Data: "mount_point is empty"})
|
|
|
return
|
|
|
}
|
|
|
err := service.MyService.Storage().UnmountStorage(mountPoint)
|
|
|
if err != nil {
|
|
|
- c.JSON(common_err.SUCCESS, model.Result{Success: common_err.SERVICE_ERROR, Message: common_err.GetMsg(common_err.SERVICE_ERROR), Data: err.Error()})
|
|
|
+ c.JSON(common_err.SERVICE_ERROR, model.Result{Success: common_err.SERVICE_ERROR, Message: common_err.GetMsg(common_err.SERVICE_ERROR), Data: err.Error()})
|
|
|
return
|
|
|
}
|
|
|
service.MyService.Storage().DeleteConfigByName(strings.ReplaceAll(mountPoint, "/mnt/", ""))
|