chore: switch Reference to using an actual reference

This commit is contained in:
Zomatree
2025-08-12 03:44:29 +01:00
parent 65fbd36624
commit ed22b3a5ce
76 changed files with 133 additions and 131 deletions

View File

@@ -15,7 +15,7 @@ use rocket_empty::EmptyResponse;
pub async fn webhook_delete(
db: &State<Database>,
user: User,
webhook_id: Reference,
webhook_id: Reference<'_>,
) -> Result<EmptyResponse> {
let webhook = webhook_id.as_webhook(db).await?;
let channel = db.fetch_channel(&webhook.channel_id).await?;

View File

@@ -10,7 +10,7 @@ use rocket_empty::EmptyResponse;
#[delete("/<webhook_id>/<token>")]
pub async fn webhook_delete_token(
db: &State<Database>,
webhook_id: Reference,
webhook_id: Reference<'_>,
token: String,
) -> Result<EmptyResponse> {
let webhook = webhook_id.as_webhook(db).await?;

View File

@@ -15,7 +15,7 @@ use validator::Validate;
#[patch("/<webhook_id>", data = "<data>")]
pub async fn webhook_edit(
db: &State<Database>,
webhook_id: Reference,
webhook_id: Reference<'_>,
user: User,
data: Json<DataEditWebhook>,
) -> Result<Json<Webhook>> {

View File

@@ -12,7 +12,7 @@ use rocket::{serde::json::Json, State};
#[patch("/<webhook_id>/<token>", data = "<data>")]
pub async fn webhook_edit_token(
db: &State<Database>,
webhook_id: Reference,
webhook_id: Reference<'_>,
token: String,
data: Json<DataEditWebhook>,
) -> Result<Json<Webhook>> {

View File

@@ -18,7 +18,7 @@ use validator::Validate;
pub async fn webhook_execute(
db: &State<Database>,
amqp: &State<AMQP>,
webhook_id: Reference,
webhook_id: Reference<'_>,
token: String,
data: Json<v0::DataMessageSend>,
idempotency: IdempotencyKey,

View File

@@ -752,7 +752,7 @@ fn convert_event(data: &str, event_name: &str) -> Result<Event> {
pub async fn webhook_execute_github(
db: &State<Database>,
amqp: &State<AMQP>,
webhook_id: Reference,
webhook_id: Reference<'_>,
token: String,
event: EventHeader<'_>,
data: String,

View File

@@ -14,7 +14,7 @@ use rocket::{serde::json::Json, State};
#[get("/<webhook_id>")]
pub async fn webhook_fetch(
db: &State<Database>,
webhook_id: Reference,
webhook_id: Reference<'_>,
user: User,
) -> Result<Json<ResponseWebhook>> {
let webhook = webhook_id.as_webhook(db).await?;

View File

@@ -10,7 +10,7 @@ use rocket::{serde::json::Json, State};
#[get("/<webhook_id>/<token>")]
pub async fn webhook_fetch_token(
db: &State<Database>,
webhook_id: Reference,
webhook_id: Reference<'_>,
token: String,
) -> Result<Json<Webhook>> {
let webhook = webhook_id.as_webhook(db).await?;