Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 47 additions & 47 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bytes = "1.9.0" # Enforce this version as Pubky and Axum conflict v1.7.1 vs v1.9
pkarr = { git = "https://github.com/pubky/pkarr", branch = "v3-rc1", package = "pkarr" }
mainline = { git = "https://github.com/pubky/mainline", branch = "v5-rc1", default-features = false }
pubky = { git = "https://github.com/pubky/pubky", branch = "v0.4.0-rc1" }
pubky-app-specs = { git = "https://github.com/pubky/pubky-app-specs", features = [
pubky-app-specs = { git = "https://github.com/pubky/pubky-app-specs", branch = "feat/uri-parser", features = [
"openapi",
] }
tokio = { version = "1.43.0", features = ["full"] }
Expand Down
7 changes: 5 additions & 2 deletions src/db/graph/queries/put.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::events::uri::ParsedUri;
use crate::models::post::PostRelationships;
use crate::models::{file::FileDetails, post::PostDetails, user::UserDetails};
use crate::types::DynError;
use neo4rs::{query, Query};
use pubky_app_specs::{ParsedUri, Resource};

// Create a user node
pub fn create_user(user: &UserDetails) -> Result<Query, DynError> {
Expand Down Expand Up @@ -110,7 +110,10 @@ fn add_relationship_params(
if let Some(uri) = uri {
let parsed_uri = ParsedUri::try_from(uri.as_str())?;
let parent_author_id = parsed_uri.user_id;
let parent_post_id = parsed_uri.post_id.ok_or("Missing post ID")?;
let parent_post_id = match parsed_uri.resource {
Resource::Post(id) => id,
_ => return Err("Reposted uri is not a Post resource".into()),
};

return Ok(cypher_query
.param(author_param, parent_author_id.as_str())
Expand Down
Loading