BREAKING CHANGE: V2 of thr SDK #12

Merged
fenpaws merged 124 commits from develop/postgresql into main 2024-07-01 20:46:28 +00:00
2 changed files with 3 additions and 8 deletions
Showing only changes of commit d4bec1d8c7 - Show all commits

View File

@ -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,

View File

@ -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 {