Project creation is workign
This commit is contained in:
@@ -25,6 +25,11 @@ struct SearchPayload {
|
||||
query: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Object)]
|
||||
struct CreateDirectoryPayload {
|
||||
pub path: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Object)]
|
||||
struct ExecShellPayload {
|
||||
pub command: String,
|
||||
@@ -79,6 +84,18 @@ impl IoApi {
|
||||
Ok(Json(entries))
|
||||
}
|
||||
|
||||
/// Create a directory at an absolute path.
|
||||
#[oai(path = "/io/fs/create/absolute", method = "post")]
|
||||
async fn create_directory_absolute(
|
||||
&self,
|
||||
payload: Json<CreateDirectoryPayload>,
|
||||
) -> OpenApiResult<Json<bool>> {
|
||||
io_fs::create_directory_absolute(payload.0.path)
|
||||
.await
|
||||
.map_err(bad_request)?;
|
||||
Ok(Json(true))
|
||||
}
|
||||
|
||||
/// Get the user's home directory.
|
||||
#[oai(path = "/io/fs/home", method = "get")]
|
||||
async fn get_home_directory(&self) -> OpenApiResult<Json<String>> {
|
||||
|
||||
Reference in New Issue
Block a user