prune empty directories

This commit is contained in:
Michael Yang
2023-09-26 17:28:14 -07:00
parent a2b210130f
commit 8608eb4760
3 changed files with 54 additions and 0 deletions

View File

@@ -378,6 +378,18 @@ func DeleteModelHandler(c *gin.Context) {
}
return
}
manifestsPath, err := GetManifestPath()
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
if err := PruneDirectory(manifestsPath); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusOK, nil)
}