refactor(delta): port routes to core webhook models
This commit is contained in:
@@ -23,11 +23,12 @@ pub async fn fetch_bot(
|
||||
}
|
||||
|
||||
Ok(Json(FetchBotResponse {
|
||||
user: revolt_models::v0::User::from(
|
||||
db.fetch_user(&bot.id).await.map_err(Error::from_core)?,
|
||||
None,
|
||||
)
|
||||
.await,
|
||||
user: db
|
||||
.fetch_user(&bot.id)
|
||||
.await
|
||||
.map_err(Error::from_core)?
|
||||
.into(None)
|
||||
.await,
|
||||
bot: bot.into(),
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -21,5 +21,5 @@ pub async fn fetch_public_bot(
|
||||
}
|
||||
|
||||
let user = db.fetch_user(&bot.id).await.map_err(Error::from_core)?;
|
||||
Ok(Json(PublicBot::from(bot, user)))
|
||||
Ok(Json(bot.into_public_bot(user)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user