From d4bec1d8c7c35f66a059e8b4e01ab9807c8965d3 Mon Sep 17 00:00:00 2001 From: soxx Date: Fri, 21 Jun 2024 14:36:38 +0200 Subject: [PATCH] fix(postgres): removed unneeded code that breaks the thing Signed-off-by: soxx --- internal/postgres/relationships.go | 5 ----- internal/postgres/relationships_test.go | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/internal/postgres/relationships.go b/internal/postgres/relationships.go index 7ee9fd7..b9919a1 100644 --- a/internal/postgres/relationships.go +++ b/internal/postgres/relationships.go @@ -2,7 +2,6 @@ package postgres import ( "context" - "fmt" "git.dragse.it/anthrove/otter-space-sdk/pkg/models" "git.dragse.it/anthrove/otter-space-sdk/pkg/models/pgModels" log "github.com/sirupsen/logrus" @@ -65,10 +64,6 @@ func CheckUserToPostLink(ctx context.Context, db *gorm.DB, anthroveUserID models exists := count > 0 - if !exists { - return false, fmt.Errorf("no post link exists") - } - log.WithFields(log.Fields{ "relationship_exists": exists, "relationship_anthrove_user_id": anthroveUserID, diff --git a/internal/postgres/relationships_test.go b/internal/postgres/relationships_test.go index d5033d9..29b29ba 100644 --- a/internal/postgres/relationships_test.go +++ b/internal/postgres/relationships_test.go @@ -240,7 +240,7 @@ func TestCheckUserToPostLink(t *testing.T) { anthrovePostID: "123456", }, want: false, - wantErr: true, + wantErr: false, }, { name: "Test 3: Valid AnthrovePostID and invalid AnthroveUserID", @@ -251,7 +251,7 @@ func TestCheckUserToPostLink(t *testing.T) { anthrovePostID: "1234", }, want: false, - wantErr: true, + wantErr: false, }, { name: "Test 4: Invalid AnthrovePostID and invalid AnthroveUserID", @@ -262,7 +262,7 @@ func TestCheckUserToPostLink(t *testing.T) { anthrovePostID: "123456", }, want: false, - wantErr: true, + wantErr: false, }, } for _, tt := range tests {