Skip to content

Commit

Permalink
chore: followの型を正確に
Browse files Browse the repository at this point in the history
  • Loading branch information
yupix committed Feb 2, 2024
1 parent 1297def commit 8e1cc0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mipac/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def follower_id(self) -> str:
return self._raw_follow["follower_id"]

@property
def follower(self) -> UserDetailedNotMe | MeDetailed | None:
def follower(self) -> UserDetailedNotMe | None:
raw_follower = self._raw_follow.get("follower")
return packed_user(raw_follower, client=self._client) if raw_follower else None

Expand All @@ -70,7 +70,7 @@ def followee_id(self) -> str:
return self._raw_follow["followee_id"]

@property
def followee(self) -> UserDetailedNotMe | MeDetailed | None:
def followee(self) -> UserDetailedNotMe | None:
raw_followee = self._raw_follow.get("followee")
return packed_user(raw_followee, client=self._client) if raw_followee else None

Expand Down
6 changes: 3 additions & 3 deletions mipac/types/follow.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from typing import NotRequired, TypedDict

from mipac.types.user import IPartialUser, IUserDetailed
from mipac.types.user import IPartialUser, IUserDetailedNotMeSchema


class IFederationFollowCommon(TypedDict):
id: str
created_at: str
followee_id: str
followee: NotRequired[IUserDetailed]
followee: NotRequired[IUserDetailedNotMeSchema]
follower_id: str
follower: NotRequired[IUserDetailed]
follower: NotRequired[IUserDetailedNotMeSchema]


class IFederationFollower(IFederationFollowCommon):
Expand Down

0 comments on commit 8e1cc0c

Please sign in to comment.