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