BLOG-128 Fix logic for determining published post access based on user login status #129
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "BLOG-128_fix_unpublished_posts_query"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
The relationship between
is_published_only
andhas_logged_in
:Package Changes
No response
Screenshots
No response
Reference
Resolves #128
Checklist
/improve
PR Code Suggestions ✨
Rename variable for clarity
The
is_published_only
variable is used as an input parameter and then reassigned torepresent the effective filter. This overloading can be confusing. Introduce a new
variable, such as
effective_is_published_only
, to store the calculated filter,improving clarity and maintainability of the access control logic.
backend/feature/post/src/application/use_case/get_all_post_info_use_case.rs [38-44]
Suggestion importance[1-10]: 7
__
Why: Reassigning the input parameter
is_published_only
with a derived value can be confusing. Introducing a new variable likeeffective_is_published_only
improves code clarity and maintainability by explicitly separating the input from the calculated filter.