BLOG-119 fix: correct logic for is_published_only in get_all_post_info execution based on user_id presence
This commit is contained in:
parent
1f25fad44a
commit
50c9234fc3
@ -33,7 +33,7 @@ impl GetAllPostInfoUseCase for GetAllPostInfoUseCaseImpl {
|
|||||||
is_published_only: bool,
|
is_published_only: bool,
|
||||||
user_id: Option<i32>,
|
user_id: Option<i32>,
|
||||||
) -> Result<Vec<PostInfo>, PostError> {
|
) -> Result<Vec<PostInfo>, 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
|
self.post_repository
|
||||||
.get_all_post_info(is_published_only)
|
.get_all_post_info(is_published_only)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user