From e4f60695d8a2f3d13de2c121372c50ccfc964e2f Mon Sep 17 00:00:00 2001 From: silverpill Date: Thu, 2 Dec 2021 13:38:45 +0000 Subject: [PATCH] Fix thread query --- src/models/posts/queries.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/posts/queries.rs b/src/models/posts/queries.rs index 2e4aed7..8f97cf2 100644 --- a/src/models/posts/queries.rs +++ b/src/models/posts/queries.rs @@ -353,7 +353,7 @@ pub async fn get_thread( WITH RECURSIVE ancestors (id, in_reply_to_id) AS ( SELECT post.id, post.in_reply_to_id FROM post - WHERE post.id = $1 AND {condition} + WHERE post.id = $1 AND ({condition}) UNION ALL SELECT post.id, post.in_reply_to_id FROM post JOIN ancestors ON post.id = ancestors.in_reply_to_id