forked from alemi/upub
fix: fetch activity case for non embedded
This commit is contained in:
parent
34a3769fba
commit
d5c73e85e8
1 changed files with 5 additions and 2 deletions
|
@ -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}");
|
||||||
|
|
Loading…
Reference in a new issue