fix: query variable set was wrong
This commit is contained in:
parent
293881f007
commit
669bea7753
@ -60,7 +60,7 @@ func GetUserFavoritesCount(ctx context.Context, driver neo4j.DriverWithContext,
|
|||||||
var userFavoriteCount int64
|
var userFavoriteCount int64
|
||||||
|
|
||||||
query := `
|
query := `
|
||||||
MATCH (userNode:User {user_id: anthrove_user_id})
|
MATCH (userNode:User {user_id: $anthrove_user_id})
|
||||||
MATCH (userNode)-[:FAV]->(favPost:AnthrovePost)
|
MATCH (userNode)-[:FAV]->(favPost:AnthrovePost)
|
||||||
MATCH (sourceNode)-[:REFERENCE]->(favPost)
|
MATCH (sourceNode)-[:REFERENCE]->(favPost)
|
||||||
RETURN count(favPost) AS FavoritePostsCount
|
RETURN count(favPost) AS FavoritePostsCount
|
||||||
@ -100,7 +100,7 @@ func GetUserSourceLink(ctx context.Context, driver neo4j.DriverWithContext, anth
|
|||||||
userSource := make(map[string]models.AnthroveUserRelationship)
|
userSource := make(map[string]models.AnthroveUserRelationship)
|
||||||
|
|
||||||
query := `
|
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;
|
RETURN toString(r.user_id) AS sourceUserID, toString(r.username) AS sourceUsername, s.display_name as sourceDisplayName;
|
||||||
`
|
`
|
||||||
params := map[string]any{
|
params := map[string]any{
|
||||||
|
Reference in New Issue
Block a user