mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 06:13:45 +02:00
Basic working file rename modal
This commit is contained in:
19
resources/scripts/api/server/files/renameFile.ts
Normal file
19
resources/scripts/api/server/files/renameFile.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import http from '@/api/http';
|
||||
|
||||
interface Data {
|
||||
renameFrom: string;
|
||||
renameTo: string;
|
||||
}
|
||||
|
||||
export default (uuid: string, { renameFrom, renameTo }: Data): Promise<void> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.put(`/api/client/servers/${uuid}/files/rename`, {
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
rename_from: renameFrom,
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
rename_to: renameTo,
|
||||
})
|
||||
.then(() => resolve())
|
||||
.catch(reject);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user