Handle new file rename/move API
This commit is contained in:
parent
2653321fc2
commit
121f163b81
3 changed files with 22 additions and 20 deletions
|
@ -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);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue