get plugin
(
Extension(plugin): Extension<Plugin>,
Extension(maybe_session): Extension<OptionalSession>,
State(state): State<AppState>,
)
| 102 | |
| 103 | // get plugin |
| 104 | pub async fn get_plugin( |
| 105 | Extension(plugin): Extension<Plugin>, |
| 106 | Extension(maybe_session): Extension<OptionalSession>, |
| 107 | State(state): State<AppState>, |
| 108 | ) -> ApiResult<impl IntoResponse> { |
| 109 | let plugin = fetch_plugin_author( |
| 110 | &state.discord_config, |
| 111 | maybe_session.as_ref().map(|v| &v.session.user), |
| 112 | &plugin, |
| 113 | ) |
| 114 | .await?; |
| 115 | |
| 116 | Ok(Json(plugin)) |
| 117 | } |
| 118 | |
| 119 | // create plugin |
| 120 | #[derive(Deserialize)] |
nothing calls this directly
no test coverage detected