diff --git a/gighunt/src/gighunt/modules/use_cases/announcement_use_cases.py b/gighunt/src/gighunt/modules/use_cases/announcement_use_cases.py index a8fc89e..254cdfd 100644 --- a/gighunt/src/gighunt/modules/use_cases/announcement_use_cases.py +++ b/gighunt/src/gighunt/modules/use_cases/announcement_use_cases.py @@ -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): diff --git a/gighunt/src/gighunt/modules/use_cases/group_use_cases.py b/gighunt/src/gighunt/modules/use_cases/group_use_cases.py index 0a8eaa0..bc1aeb8 100644 --- a/gighunt/src/gighunt/modules/use_cases/group_use_cases.py +++ b/gighunt/src/gighunt/modules/use_cases/group_use_cases.py @@ -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): diff --git a/gighunt/src/gighunt/modules/use_cases/place_use_cases.py b/gighunt/src/gighunt/modules/use_cases/place_use_cases.py index 7dc6861..3b73220 100644 --- a/gighunt/src/gighunt/modules/use_cases/place_use_cases.py +++ b/gighunt/src/gighunt/modules/use_cases/place_use_cases.py @@ -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() diff --git a/gighunt/src/gighunt/modules/use_cases/user_use_cases.py b/gighunt/src/gighunt/modules/use_cases/user_use_cases.py index 4b216b0..20ca4cc 100644 --- a/gighunt/src/gighunt/modules/use_cases/user_use_cases.py +++ b/gighunt/src/gighunt/modules/use_cases/user_use_cases.py @@ -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):