Skip to content

Commit 676b933

Browse files
committed
feat: propagate max_count #192
1 parent 9e4e98d commit 676b933

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

time_tracker_api/projects/projects_model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ def get_all(self, conditions: dict = None, **kwargs) -> list:
7777
"""
7878
event_ctx = self.create_event_context("read-many")
7979
customer_dao = customers_create_dao()
80-
customers = customer_dao.get_all()
80+
customers = customer_dao.get_all(
81+
max_count=kwargs.get('max_count', None)
82+
)
8183

8284
customers_id = [customer.id for customer in customers]
8385
conditions = conditions if conditions else {}

time_tracker_api/time_entries/time_entries_model.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ def find_all(
222222

223223
project_dao = projects_model.create_dao()
224224
projects = project_dao.get_all(
225-
custom_sql_conditions=[custom_conditions], visible_only=False
225+
custom_sql_conditions=[custom_conditions],
226+
visible_only=False,
227+
max_count=kwargs.get("max_count", None),
226228
)
227229

228230
add_project_info_to_time_entries(time_entries, projects)
@@ -231,6 +233,7 @@ def find_all(
231233
activities = activity_dao.get_all(
232234
custom_sql_conditions=[custom_conditions_activity],
233235
visible_only=False,
236+
max_count=kwargs.get("max_count", None),
234237
)
235238
add_activity_name_to_time_entries(time_entries, activities)
236239

@@ -472,8 +475,7 @@ def get_all_paginated(self, conditions: dict = None, **kwargs) -> list:
472475
)
473476

474477
return {
475-
'records_total': 0,
476-
'records_filtered': len(time_entries),
478+
'records_total': len(time_entries),
477479
'data': time_entries,
478480
}
479481

time_tracker_api/time_entries/time_entries_namespace.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,6 @@ def get(self):
353353
'records_total': fields.Integer(
354354
title='Records total', description='Total number of entries.',
355355
),
356-
'records_filtered': fields.Integer(
357-
title='Records filtered',
358-
description='Number of entries returned by the endpoint.',
359-
),
360356
'data': fields.List(fields.Nested(time_entry)),
361357
},
362358
)

0 commit comments

Comments
 (0)