Project creation is workign

This commit is contained in:
Dave
2026-02-16 20:34:03 +00:00
parent 3be9088794
commit f1e5ac72e0
12 changed files with 2225 additions and 1724 deletions

View File

@@ -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>> {