mirror of
https://github.com/yanislav-igonin/micrach
synced 2024-12-22 14:22:33 +03:00
fix: get thread by id for deleted
This commit is contained in:
parent
6bff9179f2
commit
3a8077f85d
@ -115,8 +115,8 @@ func (r *PostsRepository) GetThreadByPostID(ID int) ([]Post, error) {
|
|||||||
is_parent
|
is_parent
|
||||||
FROM posts
|
FROM posts
|
||||||
WHERE
|
WHERE
|
||||||
(id = $1 AND is_parent = true) OR parent_id = $1
|
(id = $1 AND is_parent = true AND is_deleted != true)
|
||||||
AND is_deleted != true
|
OR (parent_id = $1 AND is_deleted != true)
|
||||||
ORDER BY created_at ASC
|
ORDER BY created_at ASC
|
||||||
`
|
`
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user