Add support for copying a file or folder

This commit is contained in:
Dane Everitt 2019-03-10 18:42:53 -07:00
parent 3970a24218
commit 5aa40800c8
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
8 changed files with 119 additions and 16 deletions

View file

@ -5,10 +5,10 @@ import {ServerApplicationCredentials} from "@/store/types";
* Deletes files and/or folders from the server. You should pass through an array of
* file or folder paths to be deleted.
*/
export function deleteElement(server: string, credentials: ServerApplicationCredentials, items: Array<string>): Promise<any> {
export function deleteElement(server: string, credentials: ServerApplicationCredentials, items: Array<string>): Promise<void> {
return new Promise((resolve, reject) => {
withCredentials(server, credentials).post('/v1/server/file/delete', { items })
.then(resolve)
.then(() => resolve())
.catch(reject);
})
}