Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bugs with author and user id in postController #631

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

0lia
Copy link
Contributor

@0lia 0lia commented Dec 22, 2023

develop

GitHub Board

Issue link

#11 Issue name

Story link

#11 Story

Code reviewers

  • @github_username

Summary of issue

  • Summary of issue
  • Summary of issue

Summary of change

  • Summary of change
  • Summary of change

@0lia 0lia requested a review from handicraftsman December 25, 2023 08:23
Copy link
Contributor

@handicraftsman handicraftsman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, but do an extra check that every call to findPostsByAuthorIdAndDirections is checked, or rename the method to specify what ID you need (and that will do the check for you, by breaking the pipeline)

@@ -213,8 +214,10 @@ public Page<PostDTO> findAllByDirection(
@Override
public Page<PostDTO> findPostsByAuthorIdAndDirections(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good idea to rename the method, to make sure you don't accidentally skip some calls where id type got changed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, while this is not applicable to your current design, some apps (especially based on domain-driven-development idioms, which you might see someday) declare dedicated classes for ID types, that allows type-checking the IDs you are passing to your methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants