(
State(bus): State<Arc<MessageBus>>,
Json(cmd): Json<CreateBoard>,
)
| 12 | #[utoipa::path( post, path = "/boards", request_body=CreateBoard)] |
| 13 | #[axum_macros::debug_handler] |
| 14 | pub async fn create_board( |
| 15 | State(bus): State<Arc<MessageBus>>, |
| 16 | Json(cmd): Json<CreateBoard>, |
| 17 | ) -> Result<WebResponse<ServiceResponse>, Exception> { |
| 18 | let res = bus.handle(cmd).await.map_err(Exception)?; |
| 19 | |
| 20 | Ok(WebResponse(res)) |
| 21 | } |
| 22 | |
| 23 | #[utoipa::path(patch, path = "/boards",request_body=EditBoard)] |
| 24 | #[axum_macros::debug_handler] |