From 50c9234fc339b1c6ef52f8cd56c6e82c50215784 Mon Sep 17 00:00:00 2001 From: SquidSpirit Date: Wed, 6 Aug 2025 22:11:20 +0800 Subject: [PATCH] BLOG-119 fix: correct logic for is_published_only in get_all_post_info execution based on user_id presence --- .../post/src/application/use_case/get_all_post_info_use_case.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/feature/post/src/application/use_case/get_all_post_info_use_case.rs b/backend/feature/post/src/application/use_case/get_all_post_info_use_case.rs index 498342d..3a7eefa 100644 --- a/backend/feature/post/src/application/use_case/get_all_post_info_use_case.rs +++ b/backend/feature/post/src/application/use_case/get_all_post_info_use_case.rs @@ -33,7 +33,7 @@ impl GetAllPostInfoUseCase for GetAllPostInfoUseCaseImpl { is_published_only: bool, user_id: Option, ) -> Result, PostError> { - let is_published_only = is_published_only || user_id.is_some(); + let is_published_only = is_published_only && user_id.is_some(); self.post_repository .get_all_post_info(is_published_only)