1
0
Fork 0
forked from alemi/upub

fix: fetch activity case for non embedded

This commit is contained in:
əlemi 2024-03-26 02:46:10 +01:00
parent 34a3769fba
commit d5c73e85e8
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -24,11 +24,14 @@ pub async fn view(State(ctx) : State<Context>, Path(id): Path<String>) -> Result
.one(ctx.db()) .one(ctx.db())
.await .await
{ {
Ok(Some((activity, object))) => Ok(JsonLD( Ok(Some((activity, Some(object)))) => Ok(JsonLD(
ap_activity(activity) ap_activity(activity)
.set_object(Node::maybe_object(object.map(super::object::ap_object))) .set_object(Node::object(super::object::ap_object(object)))
.ld_context() .ld_context()
)), )),
Ok(Some((activity, None))) => Ok(JsonLD(
ap_activity(activity).ld_context()
)),
Ok(None) => Err(StatusCode::NOT_FOUND), Ok(None) => Err(StatusCode::NOT_FOUND),
Err(e) => { Err(e) => {
tracing::error!("error querying for activity: {e}"); tracing::error!("error querying for activity: {e}");