forked from jmug/stoatchat
chore: switch Reference to using an actual reference
This commit is contained in:
@@ -13,9 +13,9 @@ use rocket::State;
|
||||
pub async fn fetch_public_bot(
|
||||
db: &State<Database>,
|
||||
user: Option<User>,
|
||||
target: Reference,
|
||||
target: Reference<'_>,
|
||||
) -> Result<Json<PublicBot>> {
|
||||
let bot = db.fetch_bot(&target.id).await?;
|
||||
let bot = db.fetch_bot(target.id).await?;
|
||||
if !bot.public && user.is_none_or(|x| x.id != bot.owner) {
|
||||
return Err(create_error!(NotFound));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user