fix: maybe find_by_id is borked?

its called internal and not id, idk.....
This commit is contained in:
əlemi 2024-05-27 18:41:41 +02:00
parent 144f2b2be7
commit 823f970cdd
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -182,7 +182,8 @@ impl Context {
pub async fn is_local_internal_object(&self, internal: i64) -> crate::Result<bool> { pub async fn is_local_internal_object(&self, internal: i64) -> crate::Result<bool> {
Ok( Ok(
model::object::Entity::find_by_id(internal) model::object::Entity::find()
.filter(model::object::Column::Internal.eq(internal))
.select_only() .select_only()
.select_column(model::object::Column::Internal) .select_column(model::object::Column::Internal)
.one(self.db()) .one(self.db())
@ -193,7 +194,8 @@ impl Context {
pub async fn is_local_internal_activity(&self, internal: i64) -> crate::Result<bool> { pub async fn is_local_internal_activity(&self, internal: i64) -> crate::Result<bool> {
Ok( Ok(
model::activity::Entity::find_by_id(internal) model::activity::Entity::find()
.filter(model::activity::Column::Internal.eq(internal))
.select_only() .select_only()
.select_column(model::activity::Column::Internal) .select_column(model::activity::Column::Internal)
.one(self.db()) .one(self.db())
@ -205,7 +207,8 @@ impl Context {
#[allow(unused)] #[allow(unused)]
pub async fn is_local_internal_actor(&self, internal: i64) -> crate::Result<bool> { pub async fn is_local_internal_actor(&self, internal: i64) -> crate::Result<bool> {
Ok( Ok(
model::actor::Entity::find_by_id(internal) model::actor::Entity::find()
.filter(model::activity::Column::Internal.eq(internal))
.select_only() .select_only()
.select_column(model::actor::Column::Internal) .select_column(model::actor::Column::Internal)
.one(self.db()) .one(self.db())