fix: query variable set was wrong

This commit is contained in:
SoXX 2024-02-16 23:29:59 +01:00
parent 293881f007
commit 669bea7753

View File

@ -60,7 +60,7 @@ func GetUserFavoritesCount(ctx context.Context, driver neo4j.DriverWithContext,
var userFavoriteCount int64
query := `
MATCH (userNode:User {user_id: anthrove_user_id})
MATCH (userNode:User {user_id: $anthrove_user_id})
MATCH (userNode)-[:FAV]->(favPost:AnthrovePost)
MATCH (sourceNode)-[:REFERENCE]->(favPost)
RETURN count(favPost) AS FavoritePostsCount
@ -100,7 +100,7 @@ func GetUserSourceLink(ctx context.Context, driver neo4j.DriverWithContext, anth
userSource := make(map[string]models.AnthroveUserRelationship)
query := `
MATCH (user:User{user_id: anthrove_user_id})-[r:HAS_ACCOUNT_AT]->(s:Source)
MATCH (user:User{user_id: $anthrove_user_id})-[r:HAS_ACCOUNT_AT]->(s:Source)
RETURN toString(r.user_id) AS sourceUserID, toString(r.username) AS sourceUsername, s.display_name as sourceDisplayName;
`
params := map[string]any{