fix: removed unneeded return

This commit is contained in:
SoXX 2024-02-17 16:36:04 +01:00
parent e0e7ff2fcf
commit 1679c104bd
2 changed files with 4 additions and 9 deletions

View File

@ -10,7 +10,7 @@ import (
log "github.com/sirupsen/logrus"
)
func CreateUserNodeWithSourceRelation(ctx context.Context, driver neo4j.DriverWithContext, anthroveUserID models.AnthroveUserID, sourceDomain string, userID string, username string) (*models.AnthroveUser, error) {
func CreateUserNodeWithSourceRelation(ctx context.Context, driver neo4j.DriverWithContext, anthroveUserID models.AnthroveUserID, sourceDomain string, userID string, username string) error {
query := `
MATCH (userNode:User {user_id: $anthrove_user_id})
MATCH (sourceNode:Source {domain: $source_domain})
@ -25,7 +25,7 @@ func CreateUserNodeWithSourceRelation(ctx context.Context, driver neo4j.DriverWi
_, err := neo4j.ExecuteQuery(ctx, driver, query, params, neo4j.EagerResultTransformer)
if err != nil {
return nil, err
return err
}
var anthroveUserRelationship []models.AnthroveUserRelationship
@ -41,11 +41,6 @@ func CreateUserNodeWithSourceRelation(ctx context.Context, driver neo4j.DriverWi
},
})
anthroveUser := models.AnthroveUser{
UserID: anthroveUserID,
Relationship: anthroveUserRelationship,
}
log.WithFields(log.Fields{
"anthrove_user_id": anthroveUserID,
"source_user_id": userID,
@ -53,7 +48,7 @@ func CreateUserNodeWithSourceRelation(ctx context.Context, driver neo4j.DriverWi
"source_domain": sourceDomain,
}).Trace("graph: crated user with relationship")
return &anthroveUser, nil
return nil
}
func GetUserFavoritesCount(ctx context.Context, driver neo4j.DriverWithContext, anthroveUserID models.AnthroveUserID) (int64, error) {

View File

@ -36,7 +36,7 @@ func (g *graphConnection) Connect(ctx context.Context, endpoint string, username
return nil
}
func (g *graphConnection) AddUserWithRelationToSource(ctx context.Context, anthroveUserID models.AnthroveUserID, sourceDomain string, userID string, username string) (*models.AnthroveUser, error) {
func (g *graphConnection) AddUserWithRelationToSource(ctx context.Context, anthroveUserID models.AnthroveUserID, sourceDomain string, userID string, username string) error {
return internal.CreateUserNodeWithSourceRelation(ctx, g.driver, anthroveUserID, sourceDomain, userID, username)
}