File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,5 +10,9 @@ class GetImagesAction:
1010 def __init__ (self , image_repository : Annotated [ImageRepository , Depends ()]):
1111 self .image_repository : ImageRepository = image_repository
1212
13- async def __call__ (self , owner : UserGet , pagination : PaginationRequest ) -> PaginatedResults :
14- return await self .image_repository .get_paginated_images_by_owner_id (owner .id , pagination )
13+ async def __call__ (
14+ self , owner : UserGet , pagination : PaginationRequest
15+ ) -> PaginatedResults :
16+ return await self .image_repository .get_paginated_images_by_owner_id (
17+ owner .id , pagination
18+ )
Original file line number Diff line number Diff line change @@ -38,13 +38,11 @@ async def get_user(
3838 algorithms = [settings .jwt_algorithm ],
3939 )
4040 except PyJWTError as e :
41- print ("AAAAAAAAAAAAAAAAAA" , str (e ))
4241 return None
4342
4443 try :
4544 data = TokenData .model_validate (payload )
4645 except ValidationError as e :
47- print ("BBBBBBBBBBBBBBBBBB" , str (e ))
4846 return None
4947
5048 return await user_repository .get_by_username (data .sub )
Original file line number Diff line number Diff line change @@ -20,12 +20,12 @@ def offset(self) -> int:
2020 return self .page * self .limit
2121
2222
23- class PaginatedResults (BaseModel ):
24- results : list [BaseModel ]
23+ class PaginatedResults [ T ] (BaseModel ):
24+ results : list [T ]
2525 count : int
2626 next_page : int
2727
28- def get_results (self ) -> Iterator [BaseModel ]:
28+ def get_results (self ) -> Iterator [T ]:
2929 for result in self .results :
3030 yield result
3131
You can’t perform that action at this time.
0 commit comments