2019-05-02 04:45:39 +00:00
|
|
|
import http from "@/api/http";
|
2019-02-17 21:29:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Connects to the remote daemon and creates a new folder on the server.
|
|
|
|
*/
|
2019-05-02 04:45:39 +00:00
|
|
|
export function createFolder(server: string, directory: string, name: string): Promise<void> {
|
2019-02-17 21:29:11 +00:00
|
|
|
return new Promise((resolve, reject) => {
|
2019-05-02 04:45:39 +00:00
|
|
|
http.post(`/api/client/servers/${server}/files/create-folder`, {
|
|
|
|
directory, name,
|
|
|
|
})
|
2019-02-19 04:41:58 +00:00
|
|
|
.then(() => resolve())
|
|
|
|
.catch(reject);
|
2019-02-17 21:29:11 +00:00
|
|
|
});
|
|
|
|
}
|