1
0
Fork 0
forked from alemi/upub

fix: oops should be an OR not an AND

This commit is contained in:
əlemi 2024-07-05 04:39:03 +02:00
parent abb8095685
commit 98f1e5ee06
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -28,14 +28,18 @@ pub async fn page(
) -> crate::ApiResult<JsonLD<serde_json::Value>> { ) -> crate::ApiResult<JsonLD<serde_json::Value>> {
let context = ctx.oid(&id); let context = ctx.oid(&id);
let mut filter = Condition::all() let mut filter = Condition::any()
.add(auth.filter()) .add(auth.filter());
.add(model::object::Column::Context.eq(context));
if let Identity::Local { ref id, .. } = auth { if let Identity::Local { ref id, .. } = auth {
filter = filter.add(model::object::Column::AttributedTo.eq(id)); filter = filter.add(model::object::Column::AttributedTo.eq(id));
} }
filter = Condition::all()
.add(model::object::Column::Context.eq(context))
.add(filter);
crate::builders::paginate_feed( crate::builders::paginate_feed(
upub::url!(ctx, "/objects/{id}/context/page"), upub::url!(ctx, "/objects/{id}/context/page"),
filter, filter,