diff options
author | Colin Reeder <vpzomtrrfrt@gmail.com> | 2020-10-25 22:31:15 -0600 |
---|---|---|
committer | Colin Reeder <vpzomtrrfrt@gmail.com> | 2020-10-25 22:31:15 -0600 |
commit | cf9ad135dbeb9b3bd5517b47df9c18edee436ba6 (patch) | |
tree | 39bd83bb4109db76736a63574630b2375168e4fa | |
parent | 73b7d5fba0bd9729bbbf7be135fde5d2cbda1d3b (diff) |
Also process post href for user things list
-rw-r--r-- | src/routes/api/mod.rs | 2 | ||||
-rw-r--r-- | src/routes/api/users.rs | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/routes/api/mod.rs b/src/routes/api/mod.rs index 14c7f71..05c9ec0 100644 --- a/src/routes/api/mod.rs +++ b/src/routes/api/mod.rs @@ -143,7 +143,7 @@ enum RespThingInfo<'a> { #[serde(rename = "post")] Post { id: PostLocalID, - href: Option<&'a str>, + href: Option<Cow<'a, str>>, title: &'a str, created: String, community: RespMinimalCommunityInfo<'a>, diff --git a/src/routes/api/users.rs b/src/routes/api/users.rs index d701963..3e593b3 100644 --- a/src/routes/api/users.rs +++ b/src/routes/api/users.rs @@ -705,9 +705,11 @@ async fn route_unstable_users_things_list( let community_local = row.get(7); let community_ap_id = row.get(8); + let post_id = PostLocalID(row.get(1)); + RespThingInfo::Post { - id: PostLocalID(row.get(1)), - href: row.get(2), + id: post_id, + href: ctx.process_href_opt(row.get(2), post_id), title: row.get(3), created, community: RespMinimalCommunityInfo { |