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

[FEAT] Use ID of the logged in user for follower endpoints #8

Closed
github-actions bot opened this issue Nov 2, 2021 · 0 comments
Closed

[FEAT] Use ID of the logged in user for follower endpoints #8

github-actions bot opened this issue Nov 2, 2021 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers todo

Comments

@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2021

Related problem

Only the followers and follows of the logged in CodinGamer can be accessed with CodinGamer.get_followers and CodinGamer.get_followed.

Wanted solution

Being able to access anyone's followers and follows, the 2nd parameter to the API in HTTPClient.get_codingamer_followers and HTTPClient.get_codingamer_following need to be updated to self.state.codingamer.id

    def get_codingamer_followers(self, id: int) -> typing.List[Follower]:
        # TODO fix this to use [id, logged_in.id, None]
        return self.request("CodinGamer", "findFollowers", [id, id, None])
    def get_codingamer_following(self, id: int) -> typing.List[Following]:
        # TODO fix this to use [id, logged_in.id]
        return self.request("CodinGamer", "findFollowing", [id, id])

Considered alternatives

Using CodinGamer.get_followers_ids and CodinGamer.get_followed_ids, but that would be slower as it requires way more requests to the API.

Additional context

None

@github-actions github-actions bot added the todo label Nov 2, 2021
@takos22 takos22 added the enhancement New feature or request label Nov 2, 2021
@takos22 takos22 self-assigned this Nov 2, 2021
@takos22 takos22 changed the title fix this to use [id, logged_in.id, None] Use ID of the logged in user for follower endpoints Nov 2, 2021
@takos22 takos22 added the good first issue Good for newcomers label Nov 2, 2021
@takos22 takos22 changed the title Use ID of the logged in user for follower endpoints [FR] Use ID of the logged in user for follower endpoints Nov 2, 2021
@takos22 takos22 removed their assignment Nov 2, 2021
@takos22 takos22 closed this as completed Jun 20, 2022
@takos22 takos22 changed the title [FR] Use ID of the logged in user for follower endpoints [FEAT] Use ID of the logged in user for follower endpoints Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers todo
Projects
None yet
Development

No branches or pull requests

1 participant