diff --git a/src/handlers/file.rs b/src/handlers/file.rs index f8e3b15..d4b5bcd 100644 --- a/src/handlers/file.rs +++ b/src/handlers/file.rs @@ -42,10 +42,7 @@ use crate::services::FileService; ), tag = "Files" )] -pub async fn get( - State(ctx): State>, - Path((id, path)): Path<(Uuid, String)>, -) -> Result { +pub async fn get(State(ctx): State>, Path((id, path)): Path<(Uuid, String)>) -> Result { Ok(Json(FileService::get(ctx, id, path).await?)) } diff --git a/src/services/file.rs b/src/services/file.rs index 6019ed0..0ec6fb3 100644 --- a/src/services/file.rs +++ b/src/services/file.rs @@ -38,12 +38,7 @@ impl FileService { } /// Create a file to the workspace. - pub async fn create( - ctx: Arc, - id: Uuid, - path: String, - content: String, - ) -> Result { + pub async fn create(ctx: Arc, id: Uuid, path: String, content: String) -> Result { let data = content.into_bytes(); let req = Synchronization { kind: EventKinds::Create, @@ -60,12 +55,7 @@ impl FileService { } /// Update a file to the workspace. - pub async fn update( - _ctx: Arc, - _id: Uuid, - _path: String, - _content: String, - ) -> Result { + pub async fn update(_ctx: Arc, _id: Uuid, _path: String, _content: String) -> Result { // refer to create() method. todo!() } @@ -77,23 +67,13 @@ impl FileService { } /// Copy a file to the destination path on the workspace. - pub async fn copy( - _ctx: Arc, - _id: Uuid, - _path: String, - _destination: String, - ) -> Result { + pub async fn copy(_ctx: Arc, _id: Uuid, _path: String, _destination: String) -> Result { // refer to create() method. todo!() } /// Move a file to the destination path on the workspace. - pub async fn rename( - _ctx: Arc, - _id: Uuid, - _path: String, - _destination: String, - ) -> Result { + pub async fn rename(_ctx: Arc, _id: Uuid, _path: String, _destination: String) -> Result { // refer to create() method. todo!() } diff --git a/src/services/folder.rs b/src/services/folder.rs index 62438b2..b9dea82 100644 --- a/src/services/folder.rs +++ b/src/services/folder.rs @@ -25,11 +25,7 @@ use crate::utils; pub struct FolderService; impl FolderService { - pub async fn get( - ctx: Arc, - id: Uuid, - path: Option, - ) -> Result, ApiError> { + pub async fn get(ctx: Arc, id: Uuid, path: Option) -> Result, ApiError> { let playbook = ctx.client.playbooks().get(&id.to_string()).map_err(ApiError::NotFoundPlaybook)?; let source = playbook.preface.repository.unwrap(); @@ -62,21 +58,11 @@ impl FolderService { todo!() } - pub async fn copy( - _ctx: Arc, - _id: Uuid, - _path: String, - _destination: String, - ) -> Result { + pub async fn copy(_ctx: Arc, _id: Uuid, _path: String, _destination: String) -> Result { todo!() } - pub async fn rename( - _ctx: Arc, - _id: Uuid, - _path: String, - _destination: String, - ) -> Result { + pub async fn rename(_ctx: Arc, _id: Uuid, _path: String, _destination: String) -> Result { todo!() } }