forked from alemi/upub
fix: oops should be an OR not an AND
This commit is contained in:
parent
abb8095685
commit
98f1e5ee06
1 changed files with 7 additions and 3 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue