This repository has been archived on 2025-05-09. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Astral-nook/resources/assets/scripts/api/server/files/createFolder.ts

13 lines
510 B
TypeScript

import {ServerApplicationCredentials} from "@/store/types";
import {withCredentials} from "@/api/http";
/**
* Connects to the remote daemon and creates a new folder on the server.
*/
export function createFolder(server: string, credentials: ServerApplicationCredentials, path: string): Promise<void> {
return new Promise((resolve, reject) => {
withCredentials(server, credentials).post('/v1/server/file/folder', { path })
.then(() => resolve())
.catch(reject);
});
}