Handle new file rename/move API

This commit is contained in:
Dane Everitt 2020-07-11 16:20:42 -07:00
parent 2653321fc2
commit 121f163b81
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 22 additions and 20 deletions

View file

@ -1,16 +1,13 @@
import http from '@/api/http';
interface Data {
renameFrom: string;
renameTo: string;
to: string;
from: string;
}
export default (uuid: string, directory: string, files: Data[]): Promise<void> => {
return new Promise((resolve, reject) => {
http.put(`/api/client/servers/${uuid}/files/rename`, {
root: directory,
files: files.map(f => ({ from: f.renameFrom, to: f.renameTo })),
})
http.put(`/api/client/servers/${uuid}/files/rename`, { root: directory, files })
.then(() => resolve())
.catch(reject);
});