Skip to content

Commit 2dc0782

Browse files
committed
feat: propagate max_count #192
1 parent d23f38d commit 2dc0782

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,14 +222,17 @@ 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
add_project_name_to_time_entries(time_entries, projects)
228230

229231
activity_dao = activities_model.create_dao()
230232
activities = activity_dao.get_all(
231233
custom_sql_conditions=[custom_conditions_activity],
232234
visible_only=False,
235+
max_count=kwargs.get("max_count", None),
233236
)
234237
add_activity_name_to_time_entries(time_entries, activities)
235238

@@ -471,8 +474,7 @@ def get_all_paginated(self, conditions: dict = None, **kwargs) -> list:
471474
)
472475

473476
return {
474-
'records_total': 0,
475-
'records_filtered': len(time_entries),
477+
'records_total': len(time_entries),
476478
'data': time_entries,
477479
}
478480

time_tracker_api/time_entries/time_entries_namespace.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,6 @@ def get(self):
339339
'records_total': fields.Integer(
340340
title='Records total', description='Total number of entries.',
341341
),
342-
'records_filtered': fields.Integer(
343-
title='Records filtered',
344-
description='Number of entries returned by the endpoint.',
345-
),
346342
'data': fields.List(fields.Nested(time_entry)),
347343
},
348344
)

0 commit comments

Comments
 (0)