2019-02-17 21:29:11 +00:00
|
|
|
import {ServerApplicationCredentials} from "@/store/types";
|
2019-02-19 04:41:58 +00:00
|
|
|
import {withCredentials} 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-02-19 04:41:58 +00:00
|
|
|
export function createFolder(server: string, credentials: ServerApplicationCredentials, path: string): Promise<void> {
|
2019-02-17 21:29:11 +00:00
|
|
|
return new Promise((resolve, reject) => {
|
2019-02-19 04:41:58 +00:00
|
|
|
withCredentials(server, credentials).post('/v1/server/file/folder', { path })
|
|
|
|
.then(() => resolve())
|
|
|
|
.catch(reject);
|
2019-02-17 21:29:11 +00:00
|
|
|
});
|
|
|
|
}
|