fix(postgres): removed unneeded code that breaks the thing
Signed-off-by: soxx <soxx@fenpa.ws>
This commit is contained in:
parent
40ce69567a
commit
d4bec1d8c7
@ -2,7 +2,6 @@ package postgres
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"git.dragse.it/anthrove/otter-space-sdk/pkg/models"
|
"git.dragse.it/anthrove/otter-space-sdk/pkg/models"
|
||||||
"git.dragse.it/anthrove/otter-space-sdk/pkg/models/pgModels"
|
"git.dragse.it/anthrove/otter-space-sdk/pkg/models/pgModels"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
@ -65,10 +64,6 @@ func CheckUserToPostLink(ctx context.Context, db *gorm.DB, anthroveUserID models
|
|||||||
|
|
||||||
exists := count > 0
|
exists := count > 0
|
||||||
|
|
||||||
if !exists {
|
|
||||||
return false, fmt.Errorf("no post link exists")
|
|
||||||
}
|
|
||||||
|
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
"relationship_exists": exists,
|
"relationship_exists": exists,
|
||||||
"relationship_anthrove_user_id": anthroveUserID,
|
"relationship_anthrove_user_id": anthroveUserID,
|
||||||
|
@ -240,7 +240,7 @@ func TestCheckUserToPostLink(t *testing.T) {
|
|||||||
anthrovePostID: "123456",
|
anthrovePostID: "123456",
|
||||||
},
|
},
|
||||||
want: false,
|
want: false,
|
||||||
wantErr: true,
|
wantErr: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Test 3: Valid AnthrovePostID and invalid AnthroveUserID",
|
name: "Test 3: Valid AnthrovePostID and invalid AnthroveUserID",
|
||||||
@ -251,7 +251,7 @@ func TestCheckUserToPostLink(t *testing.T) {
|
|||||||
anthrovePostID: "1234",
|
anthrovePostID: "1234",
|
||||||
},
|
},
|
||||||
want: false,
|
want: false,
|
||||||
wantErr: true,
|
wantErr: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Test 4: Invalid AnthrovePostID and invalid AnthroveUserID",
|
name: "Test 4: Invalid AnthrovePostID and invalid AnthroveUserID",
|
||||||
@ -262,7 +262,7 @@ func TestCheckUserToPostLink(t *testing.T) {
|
|||||||
anthrovePostID: "123456",
|
anthrovePostID: "123456",
|
||||||
},
|
},
|
||||||
want: false,
|
want: false,
|
||||||
wantErr: true,
|
wantErr: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
Reference in New Issue
Block a user