fix: drop to itself (close #33

)
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
Henrique Dias
2019-01-06 12:01:23 +00:00
parent 7a6397af22
commit 0e7d4ef110
6 changed files with 19 additions and 14 deletions

View File

@@ -116,9 +116,9 @@ function moveCopy (items, copy = false) {
let promises = []
for (let item of items) {
let from = removePrefix(item.from)
let to = encodeURIComponent(removePrefix(item.to))
let url = `${from}?action=${copy ? 'copy' : 'rename'}&destination=${to}`
const from = removePrefix(item.from)
const to = encodeURIComponent(removePrefix(item.to))
const url = `${from}?action=${copy ? 'copy' : 'rename'}&destination=${to}`
promises.push(resourceAction(url, 'PATCH'))
}