PteroTheme/resources/scripts/api/server/files/renameFiles.ts

15 lines
379 B
TypeScript
Raw Normal View History

2019-08-03 06:22:01 +01:00
import http from '@/api/http';
interface Data {
2020-07-12 00:20:42 +01:00
to: string;
from: string;
2019-08-03 06:22:01 +01:00
}
export default (uuid: string, directory: string, files: Data[]): Promise<void> => {
2019-08-03 06:22:01 +01:00
return new Promise((resolve, reject) => {
2020-07-12 00:20:42 +01:00
http.put(`/api/client/servers/${uuid}/files/rename`, { root: directory, files })
2019-08-03 06:22:01 +01:00
.then(() => resolve())
.catch(reject);
});
};