Skip to content

Commit

Permalink
Return a list
Browse files Browse the repository at this point in the history
of PushTokenModel objects
  • Loading branch information
noxethiems committed Dec 4, 2023
1 parent 96f1f6d commit ba77e9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions identity_socializer/db/dao/push_token_dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ async def delete_push_tokens_by_user(self, user_id: str) -> None:
delete(PushTokenModel).where(PushTokenModel.user_id == user_id),
)

async def get_push_tokens(self) -> List[str]:
async def get_push_tokens(self) -> List[PushTokenModel]:
"""Get all push tokens."""
pushtokens = await self.session.execute(
select(PushTokenModel.pushtoken),
select(PushTokenModel),
)

return list(pushtokens.scalars().fetchall())
4 changes: 2 additions & 2 deletions identity_socializer/web/api/pushtoken/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List
from typing import Any, List

from fastapi import APIRouter, Depends

Expand Down Expand Up @@ -45,6 +45,6 @@ async def delete_push_tokens_by_user(
@router.get("/get_all", response_model=None)
async def get_push_tokens(
push_token_dao: PushTokenDAO = Depends(),
) -> List[str]:
) -> Any:
"""Get all push tokens."""
return await push_token_dao.get_push_tokens()

0 comments on commit ba77e9f

Please sign in to comment.