Skip to content

Commit

Permalink
db: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
YariKar committed Dec 21, 2024
1 parent 084580b commit e80eed5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __find_by_filters(self, deque, filters:FilterAnnouncement)->list:
def get_announcements(self, page: int, page_size: int, filters: FilterAnnouncement) -> Response:
cursor = self.get_all_entities().all()
deque = cursor.batch()
announcements = self.__find_by_filters(deque, filters)[(page - 1) * page_size : (page - 1) * page_size + page_size]
announcements = self.__find_by_filters(deque, filters)[(page - 1) * page_size : (page - 1) * page_size + page_size] if page_size != 0 else self.__find_by_filters(deque, filters)
announcement_list = []
star_use_cases = self.edge_use_cases.stars_use_cases
while len(announcements):
Expand Down
2 changes: 1 addition & 1 deletion gighunt/src/gighunt/modules/use_cases/group_use_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def __find_by_filters(self, deque, filters)->list:
def get_groups(self, page: int, page_size: int, filters: FilterGroup) -> Response:
cursor = self.get_all_entities().all()
deque = cursor.batch()
groups = self.__find_by_filters(deque, filters)[(page - 1) * page_size : (page - 1) * page_size + page_size]
groups = self.__find_by_filters(deque, filters)[(page - 1) * page_size : (page - 1) * page_size + page_size] if page_size != 0 else self.__find_by_filters(deque, filters)
group_list = []
star_use_cases = self.edge_use_cases.stars_use_cases
while len(groups):
Expand Down
2 changes: 1 addition & 1 deletion gighunt/src/gighunt/modules/use_cases/place_use_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __find_by_filters(self, deque, filters)->list:
def get_places(self, page: int, page_size: int, filters: FilterPlace) -> Response:
cursor = self.get_all_entities().all(skip=(page-1)*page_size, limit=page_size)
deque = cursor.batch()
places = self.__find_by_filters(deque,filters)[(page - 1) * page_size : (page - 1) * page_size + page_size]
places = self.__find_by_filters(deque,filters)[(page - 1) * page_size : (page - 1) * page_size + page_size] if page_size != 0 else self.__find_by_filters(deque, filters)
places_list = []
while len(places):
place = places.pop()
Expand Down
2 changes: 1 addition & 1 deletion gighunt/src/gighunt/modules/use_cases/user_use_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def __find_by_filters(self, deque, filters)->list:
def get_users(self, page: int, page_size: int, filters: FilterUser) -> Response:
query_filters = self.__create_filters(filters)
deque = self.get_all_entities().all().batch()
users = self.__find_by_filters(deque, filters)[(page - 1) * page_size : (page - 1) * page_size + page_size]
users = self.__find_by_filters(deque, filters)[(page - 1) * page_size : (page - 1) * page_size + page_size] if page_size != 0 else self.__find_by_filters(deque, filters)
users_list = []
star_use_cases = self.edge_use_cases.stars_use_cases
while len(users):
Expand Down

0 comments on commit e80eed5

Please sign in to comment.