From 3a8077f85d2f13998b5a1e0ae786a19d1c42b08d Mon Sep 17 00:00:00 2001 From: Yanislav Igonin Date: Fri, 22 Oct 2021 15:36:50 +0300 Subject: [PATCH] fix: get thread by id for deleted --- repositories/posts_repository.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repositories/posts_repository.go b/repositories/posts_repository.go index 1a151f2..a1489d0 100644 --- a/repositories/posts_repository.go +++ b/repositories/posts_repository.go @@ -115,8 +115,8 @@ func (r *PostsRepository) GetThreadByPostID(ID int) ([]Post, error) { is_parent FROM posts WHERE - (id = $1 AND is_parent = true) OR parent_id = $1 - AND is_deleted != true + (id = $1 AND is_parent = true AND is_deleted != true) + OR (parent_id = $1 AND is_deleted != true) ORDER BY created_at ASC `