test(server/search): add tests for searching

This commit is contained in:
hexxa 2022-07-23 22:24:32 +08:00 committed by Hexxa
parent 826d472a96
commit bd2e831a5d
4 changed files with 78 additions and 7 deletions

View file

@ -440,13 +440,13 @@ func (h *FileHandlers) Move(c *gin.Context) {
return
}
newPathBase := filepath.Base(newPath)
err = h.deps.FileIndex().AddPath(newPathBase)
newPathDir := filepath.Dir(newPath)
err = h.deps.FileIndex().AddPath(newPathDir)
if err != nil {
c.JSON(q.ErrResp(c, 500, err))
return
}
err = h.deps.FileIndex().MovePath(oldPath, newPathBase)
err = h.deps.FileIndex().MovePath(oldPath, newPathDir)
if err != nil {
c.JSON(q.ErrResp(c, 500, err))
return