Basic working file rename modal

This commit is contained in:
Dane Everitt 2019-08-02 22:22:01 -07:00
parent f4d0694670
commit 2716ff8841
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
8 changed files with 120 additions and 12 deletions

View 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);
});
};