question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

revert is not called during use removeFile()

See original GitHub issue

Hello, files are deleted, but the revert request to the server does not come.

let files = this.$refs.pond[0].$children[0].getFiles()
files.forEach(file => {
     this.$refs.pond[0].$children[0].removeFile(file)
})

The revert request comes only when I click the delete button on the file.

How can I call revert manually to delete the file on the server? Thanks!

server: {
          restore: "?load=",
          url: "/api/products",
          headers: {
            "X-CSRF-TOKEN": document.head.querySelector('meta[name="csrf-token"]').content
          }
<file-pond
      name="file"
      class-name=""
      ref="pond"
      :label-idle="label"
      :allow-multiple="multiple"
      :max-files="maxFiles"
      :accepted-file-types="fileType"
      :allow-revert="true"
      :force-revert="true"
      @warning="onWarning"
      @init="onInit"
      @processfilerevert="onRevert"
      @updatefiles="onUpdateFiles"
      @removefile="onRemoveFile"
      @processfile="onAddFile"
      :required="true"
      item-insert-location="after"
/>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
rikschenninkcommented, Dec 23, 2021

@lokpro I’ve updated the docs.

1reaction
september-evgenycommented, Oct 27, 2019

solved the problem like that:

    const files = this.$refs.pond.getFiles()
    files.forEach(file => {
      if (file.origin === 1 || file.origin === 2) {
        axios.delete('/api/products', {data: file.serverId})
        this.$refs.pond.removeFile(file)
      }
    })
Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove a modified file from pull request - git - Stack Overflow
Overwrite the modified file(s) with the file in another branch, let's consider it's master: git checkout origin/master -- src/main/java/HelloWorld.java.
Read more >
FileSystemEntry.remove() - Web APIs - MDN Web Docs
The FileSystemEntry interface's method remove() deletes the file or directory from the file system. Directories must be empty before they can be ...
Read more >
git-rm Documentation - Git
The command removes only the paths that are known to Git. File globbing matches across directory boundaries. Thus, given two directories d and...
Read more >
Undo changes in Git repository | PhpStorm Documentation
Locate the commit you want to revert in the Log tab of the Git tool window Alt+9 , right-click it and select Revert...
Read more >
os — Miscellaneous operating system interfaces — Python ...
In this case, Python uses the surrogateescape encoding error handler, ... Calling putenv() directly does not change os.environ , so it's better to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found