🐛 fix can't delete and get meta

This commit is contained in:
微凉
2021-11-13 17:10:44 +08:00
parent 5f34b8ab80
commit 48a65784c7
4 changed files with 25 additions and 13 deletions

View File

@ -4,6 +4,7 @@ import (
"github.com/Xhofe/alist/model"
"github.com/Xhofe/alist/utils"
"github.com/gin-gonic/gin"
"strconv"
)
func GetMetas(c *gin.Context) {
@ -44,9 +45,14 @@ func SaveMeta(c *gin.Context) {
}
func DeleteMeta(c *gin.Context) {
path := c.Query("path")
idStr := c.Query("id")
id, err := strconv.Atoi(idStr)
if err != nil {
ErrorResp(c, err, 400)
return
}
//path = utils.ParsePath(path)
if err := model.DeleteMeta(path); err != nil {
if err := model.DeleteMeta(uint(id)); err != nil {
ErrorResp(c, err, 500)
return
}