forked from jmug/stoatchat
chore: switch Reference to using an actual reference
This commit is contained in:
@@ -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?;
|
||||
|
||||
@@ -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?;
|
||||
|
||||
@@ -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>> {
|
||||
|
||||
@@ -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>> {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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?;
|
||||
|
||||
@@ -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?;
|
||||
|
||||
Reference in New Issue
Block a user