diff --git a/crates/delta/src/routes/webhooks/mod.rs b/crates/delta/src/routes/webhooks/mod.rs index eb2d5d0e..6b0ef448 100644 --- a/crates/delta/src/routes/webhooks/mod.rs +++ b/crates/delta/src/routes/webhooks/mod.rs @@ -12,13 +12,13 @@ mod webhook_execute_github; pub fn routes() -> (Vec, OpenApi) { openapi_get_routes_spec![ - webhook_delete_token::req, - webhook_delete::req, - webhook_edit_token::req, - webhook_edit::req, - webhook_execute::req, - webhook_fetch_token::req, - webhook_fetch::req, - webhook_execute_github::req + webhook_delete_token::webhook_delete_token, + webhook_delete::webhook_delete, + webhook_edit_token::webhook_edit_token, + webhook_edit::webhook_edit, + webhook_execute_github::webhook_execute_github, + webhook_execute::webhook_execute, + webhook_fetch_token::webhook_fetch_token, + webhook_fetch::webhook_fetch, ] } diff --git a/crates/delta/src/routes/webhooks/webhook_delete.rs b/crates/delta/src/routes/webhooks/webhook_delete.rs index 040f5de6..7a4dfc9d 100644 --- a/crates/delta/src/routes/webhooks/webhook_delete.rs +++ b/crates/delta/src/routes/webhooks/webhook_delete.rs @@ -5,7 +5,7 @@ use revolt_quark::{Db, Ref, Result, EmptyResponse, models::User, perms, Permissi /// deletes a webhook #[openapi(tag = "Webhooks")] #[delete("/")] -pub async fn req(db: &Db, user: User, target: Ref) -> Result { +pub async fn webhook_delete(db: &Db, user: User, target: Ref) -> Result { let webhook = target.as_webhook(db).await?; let channel = Ref::from_unchecked(webhook.channel.clone()).as_channel(db).await?; diff --git a/crates/delta/src/routes/webhooks/webhook_delete_token.rs b/crates/delta/src/routes/webhooks/webhook_delete_token.rs index b0dea18d..dffcdd83 100644 --- a/crates/delta/src/routes/webhooks/webhook_delete_token.rs +++ b/crates/delta/src/routes/webhooks/webhook_delete_token.rs @@ -5,7 +5,7 @@ use revolt_quark::{Db, Ref, Result, EmptyResponse, Error}; /// deletes a webhook with a token #[openapi(tag = "Webhooks")] #[delete("//")] -pub async fn req(db: &Db, target: Ref, token: String) -> Result { +pub async fn webhook_delete_token(db: &Db, target: Ref, token: String) -> Result { let webhook = target.as_webhook(db).await?; (webhook.token.as_deref() == Some(&token)) diff --git a/crates/delta/src/routes/webhooks/webhook_edit.rs b/crates/delta/src/routes/webhooks/webhook_edit.rs index 0271eb66..8644aa2f 100644 --- a/crates/delta/src/routes/webhooks/webhook_edit.rs +++ b/crates/delta/src/routes/webhooks/webhook_edit.rs @@ -20,7 +20,7 @@ pub struct WebhookEditBody { /// edits a webhook #[openapi(tag = "Webhooks")] #[patch("/", data="")] -pub async fn req(db: &Db, target: Ref, user: User, data: Json) -> Result> { +pub async fn webhook_edit(db: &Db, target: Ref, user: User, data: Json) -> Result> { let data = data.into_inner(); data.validate() .map_err(|error| Error::FailedValidation { error })?; diff --git a/crates/delta/src/routes/webhooks/webhook_edit_token.rs b/crates/delta/src/routes/webhooks/webhook_edit_token.rs index a5256310..f8082f74 100644 --- a/crates/delta/src/routes/webhooks/webhook_edit_token.rs +++ b/crates/delta/src/routes/webhooks/webhook_edit_token.rs @@ -20,7 +20,7 @@ pub struct WebhookEditBody { /// edits a webhook with a token #[openapi(tag = "Webhooks")] #[patch("//", data="")] -pub async fn req(db: &Db, target: Ref, token: String, data: Json) -> Result> { +pub async fn webhook_edit_token(db: &Db, target: Ref, token: String, data: Json) -> Result> { let data = data.into_inner(); data.validate() .map_err(|error| Error::FailedValidation { error })?; diff --git a/crates/delta/src/routes/webhooks/webhook_execute.rs b/crates/delta/src/routes/webhooks/webhook_execute.rs index 090f3ad6..40a9fdaf 100644 --- a/crates/delta/src/routes/webhooks/webhook_execute.rs +++ b/crates/delta/src/routes/webhooks/webhook_execute.rs @@ -8,7 +8,7 @@ use validator::Validate; /// executes a webhook and sends a message #[openapi(tag = "Webhooks")] #[post("//", data="")] -pub async fn req(db: &Db, target: Ref, token: String, data: Json, idempotency: IdempotencyKey) -> Result> { +pub async fn webhook_execute(db: &Db, target: Ref, token: String, data: Json, idempotency: IdempotencyKey) -> Result> { let data = data.into_inner(); data.validate() .map_err(|error| Error::FailedValidation { error })?; diff --git a/crates/delta/src/routes/webhooks/webhook_execute_github.rs b/crates/delta/src/routes/webhooks/webhook_execute_github.rs index e8538856..1e094505 100644 --- a/crates/delta/src/routes/webhooks/webhook_execute_github.rs +++ b/crates/delta/src/routes/webhooks/webhook_execute_github.rs @@ -742,7 +742,7 @@ fn convert_event(data: &str, event_name: &str) -> Result { /// executes a webhook specific to github and sends a message containg the relavent info about the event #[openapi(tag = "Webhooks")] #[post("///github", data="")] -pub async fn req(db: &Db, target: Ref, token: String, event: EventHeader<'_>, data: String) -> Result<()> { +pub async fn webhook_execute_github(db: &Db, target: Ref, token: String, event: EventHeader<'_>, data: String) -> Result<()> { let webhook = target.as_webhook(db).await?; (webhook.token.as_deref() == Some(&token)) diff --git a/crates/delta/src/routes/webhooks/webhook_fetch.rs b/crates/delta/src/routes/webhooks/webhook_fetch.rs index 53d87989..3808327f 100644 --- a/crates/delta/src/routes/webhooks/webhook_fetch.rs +++ b/crates/delta/src/routes/webhooks/webhook_fetch.rs @@ -21,7 +21,7 @@ pub struct WebhookData { /// gets a webhook #[openapi(tag = "Webhooks")] #[get("/")] -pub async fn req(db: &Db, target: Ref) -> Result> { +pub async fn webhook_fetch(db: &Db, target: Ref) -> Result> { let Webhook { id, name, avatar, channel, .. } = target.as_webhook(db).await?; Ok(Json(WebhookData { id, name, avatar, channel })) diff --git a/crates/delta/src/routes/webhooks/webhook_fetch_token.rs b/crates/delta/src/routes/webhooks/webhook_fetch_token.rs index 04ce4d62..4b9a3f0a 100644 --- a/crates/delta/src/routes/webhooks/webhook_fetch_token.rs +++ b/crates/delta/src/routes/webhooks/webhook_fetch_token.rs @@ -6,7 +6,7 @@ use rocket::serde::json::Json; /// gets a webhook with a token #[openapi(tag = "Webhooks")] #[get("//")] -pub async fn req(db: &Db, target: Ref, token: String) -> Result> { +pub async fn webhook_fetch_token(db: &Db, target: Ref, token: String) -> Result> { let webhook = target.as_webhook(db).await?; (webhook.token.as_deref() == Some(&token))