We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cf9c783 commit 0c22148Copy full SHA for 0c22148
1 file changed
repository/likes_repository.go
@@ -69,7 +69,7 @@ func (r *likesRepository) ErrUnlikePostById(ctx context.Context, tx *gorm.DB, po
69
PostID: postId,
70
}
71
72
- if err := tx.WithContext(ctx).Where("user_id = ? AND post_id = ?", userId, postId).Delete(&likes).Error; err != nil {
+ if err := tx.WithContext(ctx).Where("user_id = ? AND post_id = ?", userId, postId).Unscoped().Delete(&likes).Error; err != nil {
73
return err
74
75
0 commit comments