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

Moved follow repositories & methods to AccountService, created AccountService object in InboxController #122

Merged
merged 3 commits into from
Sep 5, 2023

Conversation

shirlsli
Copy link
Collaborator

  • Moved followerHandle, userFollow, and paginateFollowers from InboxController to AccountService
  • Created AccountService object in InboxController for usersFollowers and usersFollowing to access methods in AccountService

String follower = inboxNode.get("actor").asText();
if (requestType.equals("Follow")) {
// check id
if (accountRepository.findItemByAcct(id)==null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this will never be null.

the if else should be removed and line 99 should start with

return accountRepository.findItemByAcct(id).switchOnEmpty(Mono.error(new RuntimeException("Error: Account to follow does not exist")
.then(followersRepository.findItemById(id)

@@ -21,7 +22,7 @@
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
Copy link
Contributor

Choose a reason for hiding this comment

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

need to stick with 17

@@ -13,6 +13,7 @@
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
Copy link
Contributor

Choose a reason for hiding this comment

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

reformat file to get rid of extra import and space

@shirlsli shirlsli merged commit 3536970 into main Sep 5, 2023
1 check passed
@shirlsli shirlsli deleted the account-service branch September 5, 2023 23:29
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