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())
.await
{
Ok(Some((activity, object))) => Ok(JsonLD(
Ok(Some((activity, Some(object)))) => Ok(JsonLD(
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()
)),
Ok(Some((activity, None))) => Ok(JsonLD(
ap_activity(activity).ld_context()
)),
Ok(None) => Err(StatusCode::NOT_FOUND),
Err(e) => {
tracing::error!("error querying for activity: {e}");