From 7762f2f88b302306a9c8af1bcf904bbd9b6c73f6 Mon Sep 17 00:00:00 2001 From: Emmie Maeda Date: Sun, 15 Oct 2023 03:20:56 -0400 Subject: [PATCH] Migrate stubbed file methods. --- deepwell/src/api.rs | 14 +++++--------- deepwell/src/endpoints/file.rs | 25 ++++++++++++++++++++----- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/deepwell/src/api.rs b/deepwell/src/api.rs index 2e2c1ec230a..3ac1fc2a040 100644 --- a/deepwell/src/api.rs +++ b/deepwell/src/api.rs @@ -248,12 +248,12 @@ async fn build_module(app_state: ServerState) -> anyhow::Result tide::Server { fn tide_build_routes(mut app: tide::Server) -> tide::Server { // Files - app.at("/file").post(file_edit).delete(file_delete); app.at("/file/get").put(file_retrieve); - app.at("/file/upload").post(file_create); - app.at("/file/move").post(file_move); - app.at("/file/restore").post(file_restore); // File revisions app.at("/file/revision").put(file_revision_put); diff --git a/deepwell/src/endpoints/file.rs b/deepwell/src/endpoints/file.rs index 4a936005cbf..ac82a180b89 100644 --- a/deepwell/src/endpoints/file.rs +++ b/deepwell/src/endpoints/file.rs @@ -53,23 +53,38 @@ pub async fn file_retrieve(mut req: ApiRequest) -> ApiResponse { Ok(response) } -pub async fn file_create(_req: ApiRequest) -> ApiResponse { +pub async fn file_upload( + _ctx: &ServiceContext<'_>, + _params: Params<'static>, +) -> Result<()> { todo!() } -pub async fn file_edit(_req: ApiRequest) -> ApiResponse { +pub async fn file_edit( + _ctx: &ServiceContext<'_>, + _params: Params<'static>, +) -> Result<()> { todo!() } -pub async fn file_delete(_req: ApiRequest) -> ApiResponse { +pub async fn file_delete( + _ctx: &ServiceContext<'_>, + _params: Params<'static>, +) -> Result<()> { todo!() } -pub async fn file_move(_req: ApiRequest) -> ApiResponse { +pub async fn file_move( + _ctx: &ServiceContext<'_>, + _params: Params<'static>, +) -> Result<()> { todo!() } -pub async fn file_restore(_req: ApiRequest) -> ApiResponse { +pub async fn file_restore( + _ctx: &ServiceContext<'_>, + _params: Params<'static>, +) -> Result<()> { todo!() }