mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-08-16 04:41:29 +00:00
17 lines
553 B
Rust
17 lines
553 B
Rust
![]() |
use crate::{
|
||
|
entities::app::{AppDetail, CreateAppParams, CreateAppRequest},
|
||
|
errors::WorkspaceError,
|
||
|
services::AppController,
|
||
|
};
|
||
|
use flowy_dispatch::prelude::{response_ok, Data, ModuleData, ResponseResult};
|
||
|
use std::{convert::TryInto, sync::Arc};
|
||
|
|
||
|
pub async fn create_app(
|
||
|
data: Data<CreateAppRequest>,
|
||
|
controller: ModuleData<Arc<AppController>>,
|
||
|
) -> ResponseResult<AppDetail, WorkspaceError> {
|
||
|
let params: CreateAppParams = data.into_inner().try_into()?;
|
||
|
let detail = controller.save_app(params)?;
|
||
|
response_ok(detail)
|
||
|
}
|