BREAKING CHANGE: V2 of thr SDK #12
@ -39,7 +39,14 @@ func CheckIfAnthrovePostNodeExistsByAnthroveID(ctx context.Context, db *gorm.DB,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func CheckIfAnthrovePostNodeExistsBySourceURL(ctx context.Context, db *gorm.DB, sourceURL string) (bool, error) {
|
func CheckIfAnthrovePostNodeExistsBySourceURL(ctx context.Context, db *gorm.DB, sourceURL string) (bool, error) {
|
||||||
return executeCheckQuery(ctx, db, "url = ?", sourceURL)
|
var size int64
|
||||||
|
err := db.WithContext(ctx).Model(&pgModels.PostReference{}).Where("url = ?", sourceURL).Count(&size).Error
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return size > 0, 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) {
|
||||||
|
Reference in New Issue
Block a user