forked from alemi/upub
fix: also for object
This commit is contained in:
parent
9da5b09ec6
commit
b222090aee
1 changed files with 2 additions and 2 deletions
|
@ -3,12 +3,12 @@ use sea_orm::EntityTrait;
|
|||
|
||||
use crate::{activitystream::Base, model::object, server::Context};
|
||||
|
||||
use super::JsonLD;
|
||||
use super::{jsonld::LD, JsonLD};
|
||||
|
||||
|
||||
pub async fn view(State(ctx) : State<Context>, Path(id): Path<String>) -> Result<JsonLD<serde_json::Value>, StatusCode> {
|
||||
match object::Entity::find_by_id(ctx.oid(id)).one(ctx.db()).await {
|
||||
Ok(Some(object)) => Ok(JsonLD(object.underlying_json_object())),
|
||||
Ok(Some(object)) => Ok(JsonLD(object.underlying_json_object().ld_context())),
|
||||
Ok(None) => Err(StatusCode::NOT_FOUND),
|
||||
Err(e) => {
|
||||
tracing::error!("error querying for object: {e}");
|
||||
|
|
Loading…
Reference in a new issue