Skip to content

Commit

Permalink
Fix user graph query handling of None values
Browse files Browse the repository at this point in the history
  • Loading branch information
amirRamirfatahi committed Dec 2, 2024
1 parent bd40908 commit 9c903c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/target
.env
docker/.database
docker/.database*
docker/.env
**/.DS_Store
/static
10 changes: 5 additions & 5 deletions src/db/graph/queries/put.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ pub fn create_user(user: &UserDetails) -> Result<Query, DynError> {
"MERGE (u:User {id: $id})
SET u.name = $name, u.bio = $bio, u.status = $status, u.links = $links, u.image = $image, u.indexed_at = $indexed_at;",
)
.param("id", user.id.as_ref())
.param("name", user.name.to_string())
.param("bio", user.bio.as_ref().unwrap_or(&"null".to_string()).to_string())
.param("status", user.status.as_ref().unwrap_or(&"null".to_string()).to_string())
.param("id", user.id.to_string())
.param("name", user.name.clone())
.param("bio", user.bio.clone())
.param("status", user.status.clone())
.param("links", links)
.param("image", user.image.as_ref().unwrap_or(&String::from("null")).to_string())
.param("image", user.image.clone())
.param("indexed_at", user.indexed_at);

Ok(query)
Expand Down

0 comments on commit 9c903c5

Please sign in to comment.