diff --git a/identity_socializer/web/api/auth/schema.py b/identity_socializer/web/api/auth/schema.py index 29bbcee..626eb76 100644 --- a/identity_socializer/web/api/auth/schema.py +++ b/identity_socializer/web/api/auth/schema.py @@ -46,6 +46,7 @@ class AppUserModel(BaseModel): profile_photo_id: Optional[str] ubication: Optional[str] is_followed: Optional[bool] + is_followed_back: Optional[bool] = False blocked: bool = False certified: bool = False model_config = ConfigDict(from_attributes=True) diff --git a/identity_socializer/web/api/utils.py b/identity_socializer/web/api/utils.py index 18962fc..e1f798f 100644 --- a/identity_socializer/web/api/utils.py +++ b/identity_socializer/web/api/utils.py @@ -27,6 +27,7 @@ async def complete_user( ) -> AppUserModel: """Returns a user with additional information.""" is_followed = await relationship_dao.is_followed_by_user(current_user_id, user.id) + is_followed_back = await relationship_dao.is_followed_by_user(user.id, current_user_id) return AppUserModel( id=user.id, @@ -39,5 +40,6 @@ async def complete_user( profile_photo_id=user.profile_photo_id, ubication=user.ubication, is_followed=is_followed, + is_followed_back=is_followed_back, blocked=user.blocked, )