mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-09-27 14:00:17 +00:00
comment
This commit is contained in:
parent
e6795946e4
commit
23006baa0c
1 changed files with 4 additions and 0 deletions
|
@ -65,6 +65,7 @@ where
|
|||
let path = service_req.path().replace("/api/v3/", "").replace("/", "_");
|
||||
// TODO: naming can be a bit silly, `POST /api/v3/post` becomes `api_before_post_post`
|
||||
let plugin_hook = format!("api_before_{method}_{path}").to_lowercase();
|
||||
|
||||
info!("Calling plugin hook {}", &plugin_hook);
|
||||
if let Some(mut plugins) = load_plugins()? {
|
||||
if plugins.function_exists(&plugin_hook) {
|
||||
|
@ -79,6 +80,9 @@ where
|
|||
}
|
||||
}
|
||||
let res = svc.call(service_req).await?;
|
||||
|
||||
// TODO: add after hook
|
||||
|
||||
Ok(res)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue