fix: renamed attributes and removed unneeded pointer

This commit is contained in:
SoXX 2024-02-16 23:11:42 +01:00
parent 06fa9a1d5a
commit 5435f8448d
3 changed files with 7 additions and 7 deletions

View File

@ -64,7 +64,7 @@ func EstablishUserToPostLink(ctx context.Context, driver neo4j.DriverWithContext
return nil
}
func CheckUserToPostLink(ctx context.Context, driver neo4j.DriverWithContext, anthroveUserID models.AnthroveUserID, sourcePostID string, sourcePostUrl string) (bool, error) {
func CheckUserToPostLink(ctx context.Context, driver neo4j.DriverWithContext, anthroveUserID models.AnthroveUserID, sourcePostID string, sourceUrl string) (bool, error) {
query := `
OPTIONAL MATCH (:User {user_id: $anthrove_user_id})-[f:FAV]->(:AnthrovePost)<-[:REFERENCE{source_post_id: $source_post_id}]-(:Source{domain: $source_domain})
RETURN COUNT(f) > 0 AS hasRelationship
@ -73,7 +73,7 @@ func CheckUserToPostLink(ctx context.Context, driver neo4j.DriverWithContext, an
params := map[string]any{
"anthrove_user_id": anthroveUserID,
"source_post_id": sourcePostID,
"source_domain": sourcePostUrl,
"source_domain": sourceUrl,
}
result, err := neo4j.ExecuteQuery(ctx, driver, query, params, neo4j.EagerResultTransformer)

View File

@ -20,7 +20,7 @@ type OtterSpace interface {
AddPost(ctx context.Context, anthrovePost *models.AnthrovePost) error
// AddTagWithRelationToPost uploads a tag associated with an Anthrove post to the graph
AddTagWithRelationToPost(ctx context.Context, anthrovePostID *models.AnthrovePostID, anthroveTag *models.AnthroveTag) error
AddTagWithRelationToPost(ctx context.Context, anthrovePostID models.AnthrovePostID, anthroveTag *models.AnthroveTag) error
// LinkPostWithSource establishes a link between a post and a source in the graph
LinkPostWithSource(ctx context.Context, anthrovePostID models.AnthrovePostID, anthroveSourceDomain string, anthrovePostRelationship *models.AnthrovePostRelationship) error
@ -29,7 +29,7 @@ type OtterSpace interface {
LinkUserWithPost(ctx context.Context, anthroveUser *models.AnthroveUser, anthrovePost *models.AnthrovePost) error
// CheckUserPostLink checks if a link between a user and a post exists in the graph
CheckUserPostLink(ctx context.Context, anthroveUserID models.AnthroveUserID, sourcePostID string, sourcePostUrl string) (bool, error)
CheckUserPostLink(ctx context.Context, anthroveUserID models.AnthroveUserID, sourcePostID string, sourceUrl string) (bool, error)
// CheckPostNodeExistsByAnthroveID checks if an Anthrove post node exists in the graph by its Anthrove ID
CheckPostNodeExistsByAnthroveID(ctx context.Context, anthrovePost *models.AnthrovePost) (*models.AnthrovePost, bool, error)

View File

@ -48,7 +48,7 @@ func (g *graphConnection) AddPost(ctx context.Context, anthrovePost *models.Anth
return internal.CreateAnthrovePostNode(ctx, g.driver, anthrovePost)
}
func (g *graphConnection) AddTagWithRelationToPost(ctx context.Context, anthrovePostID *models.AnthrovePostID, anthroveTag *models.AnthroveTag) error {
func (g *graphConnection) AddTagWithRelationToPost(ctx context.Context, anthrovePostID models.AnthrovePostID, anthroveTag *models.AnthroveTag) error {
return internal.CreateTagNodeWitRelation(ctx, g.driver, anthrovePostID, anthroveTag)
}
@ -60,8 +60,8 @@ func (g *graphConnection) LinkUserWithPost(ctx context.Context, anthroveUser *mo
return internal.EstablishUserToPostLink(ctx, g.driver, anthroveUser, anthrovePost)
}
func (g *graphConnection) CheckUserPostLink(ctx context.Context, anthroveUserID models.AnthroveUserID, sourcePostID string, sourcePostUrl string) (bool, error) {
return internal.CheckUserToPostLink(ctx, g.driver, anthroveUserID, sourcePostID, sourcePostUrl)
func (g *graphConnection) CheckUserPostLink(ctx context.Context, anthroveUserID models.AnthroveUserID, sourcePostID string, sourceUrl string) (bool, error) {
return internal.CheckUserToPostLink(ctx, g.driver, anthroveUserID, sourcePostID, sourceUrl)
}
func (g *graphConnection) CheckPostNodeExistsByAnthroveID(ctx context.Context, anthrovePost *models.AnthrovePost) (*models.AnthrovePost, bool, error) {