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 3 deletions
Showing only changes of commit 0b7b6beccd - Show all commits

View File

@ -40,7 +40,7 @@ func CheckIfAnthrovePostNodeExistsByAnthroveID(ctx context.Context, db *gorm.DB,
return executeCheckQuery(ctx, db, "id = ?", string(anthrovePostID)) return executeCheckQuery(ctx, db, "id = ?", string(anthrovePostID))
} }
func CheckIfAnthrovePostNodeExistsBySourceURL(ctx context.Context, db *gorm.DB, sourceURL string) (graphModels.AnthrovePost, bool, error) { func CheckIfAnthrovePostNodeExistsBySourceURL(ctx context.Context, db *gorm.DB, sourceURL string) (*graphModels.AnthrovePost, bool, error) {
var post pgModels.Post var post pgModels.Post
err := db.WithContext(ctx).Model(&pgModels.Post{}).InnerJoins("References", db.Where("url = ?", sourceURL)).First(&post).Error err := db.WithContext(ctx).Model(&pgModels.Post{}).InnerJoins("References", db.Where("url = ?", sourceURL)).First(&post).Error
@ -59,7 +59,7 @@ func CheckIfAnthrovePostNodeExistsBySourceURL(ctx context.Context, db *gorm.DB,
//TODO Now test it! :D //TODO Now test it! :D
// Naaa // Naaa
// D: // D:
return pgPost, true, nil return &pgPost, true, nil
} }
func CheckIfAnthrovePostNodeExistsBySourceID(ctx context.Context, db *gorm.DB, sourceID string) (bool, error) { func CheckIfAnthrovePostNodeExistsBySourceID(ctx context.Context, db *gorm.DB, sourceID string) (bool, error) {

View File

@ -90,7 +90,7 @@ func (p *postgresqlConnection) CheckPostNodeExistsByAnthroveID(ctx context.Conte
// CheckPostNodeExistsBySourceURL NOT WORKING! TODO! // CheckPostNodeExistsBySourceURL NOT WORKING! TODO!
func (p *postgresqlConnection) CheckPostNodeExistsBySourceURL(ctx context.Context, sourceUrl string) (*graphModels.AnthrovePost, bool, error) { func (p *postgresqlConnection) CheckPostNodeExistsBySourceURL(ctx context.Context, sourceUrl string) (*graphModels.AnthrovePost, bool, error) {
post, exists, err := postgres.CheckIfAnthrovePostNodeExistsBySourceURL(ctx, p.db, sourceUrl) post, exists, err := postgres.CheckIfAnthrovePostNodeExistsBySourceURL(ctx, p.db, sourceUrl)
return &post, exists, err return post, exists, err
} }
// CheckPostNodeExistsBySourceID NOT WORKING! TODO! // CheckPostNodeExistsBySourceID NOT WORKING! TODO!