test(server/search): add tests for searching
This commit is contained in:
parent
826d472a96
commit
bd2e831a5d
4 changed files with 78 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue