mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 22:33:44 +02:00
Handle new file rename/move API
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user