From 6bff9179f29930f00c87eda74f126b8dfa4030d9 Mon Sep 17 00:00:00 2001 From: Yanislav Igonin Date: Fri, 22 Oct 2021 15:27:08 +0300 Subject: [PATCH] fix: deleted posts not returned --- repositories/posts_repository.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repositories/posts_repository.go b/repositories/posts_repository.go index a33b3ee..1a151f2 100644 --- a/repositories/posts_repository.go +++ b/repositories/posts_repository.go @@ -17,7 +17,7 @@ func (r *PostsRepository) Get(limit, offset int) ([]Post, error) { FROM posts WHERE is_parent = true - AND is_deleted = false + AND is_deleted != true ORDER BY updated_at DESC OFFSET $1 LIMIT $2 @@ -65,7 +65,7 @@ func (r *PostsRepository) GetCount() (int, error) { FROM posts WHERE is_parent = true - AND is_deleted = false + AND is_deleted != true ` row := Db.Pool.QueryRow(context.TODO(), sql) @@ -116,7 +116,7 @@ func (r *PostsRepository) GetThreadByPostID(ID int) ([]Post, error) { FROM posts WHERE (id = $1 AND is_parent = true) OR parent_id = $1 - AND is_deleted = false + AND is_deleted != true ORDER BY created_at ASC `