Ver código fonte

WASI folder endpoints fix

Yurii Sokolovskyi 3 meses atrás
pai
commit
f947eee802
2 arquivos alterados com 4 adições e 4 exclusões
  1. 0 1
      src/main.rs
  2. 4 3
      src/server.rs

+ 0 - 1
src/main.rs

@@ -32,7 +32,6 @@ use axum::http::{Method, StatusCode};
 use axum::response::{IntoResponse, Response};
 #[cfg(not(target_os = "wasi"))]
 use axum::routing::{get, post};
-use axum::routing::any;
 #[cfg(not(target_os = "wasi"))]
 use tower_http::cors::{Any, CorsLayer};
 

+ 4 - 3
src/server.rs

@@ -3,6 +3,7 @@ use crate::indexes::{SerializableMessage, SerializableThread};
 use serde::{Deserialize, Serialize};
 use std::fs::File;
 use std::io::{BufReader};
+use crate::{create_folder_lar, delete_folder_lar, rename_folder_lar};
 use crate::util::read_and_decompress_file;
 
 pub async fn get_folders() -> String {
@@ -136,7 +137,7 @@ struct CreateFolderRequest {
 }
 pub async fn create_folder(body: String) -> anyhow::Result<()>{
     let data: CreateFolderRequest = serde_json::from_str(&*body)?;
-    crate::imap::create_folder(data.name.clone()).await
+    create_folder_lar(data.name.clone()).await
 }
 
 #[derive(Deserialize)]
@@ -145,7 +146,7 @@ struct DeleteFolderRequest {
 }
 pub async fn delete_folder(body: String) -> anyhow::Result<()>{
     let data: DeleteFolderRequest = serde_json::from_str(&*body)?;
-    crate::imap::delete_folder(data.name.clone()).await
+    delete_folder_lar(data.name.clone()).await
 }
 
 #[derive(Deserialize)]
@@ -155,5 +156,5 @@ struct RenameFolderRequest {
 }
 pub async fn rename_folder(body: String) -> anyhow::Result<()>{
     let data: RenameFolderRequest = serde_json::from_str(&*body)?;
-    crate::imap::rename_folder(data.old_name.clone(), data.new_name.clone()).await
+    rename_folder_lar(data.old_name.clone(), data.new_name.clone()).await
 }