Skip to content

Commit b7a3828

Browse files
committed
fix: #215 remove atribute filters in last time entry
1 parent 941ef94 commit b7a3828

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

time_tracker_api/time_entries/time_entries_dao.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
TimeEntryCosmosDBRepository,
2929
)
3030
from time_tracker_api.database import CRUDDao, APICosmosDBDao
31+
from time_tracker_api.security import current_user_id
3132

3233

3334
class TimeEntriesDao(CRUDDao):

time_tracker_api/time_entries/time_entries_namespace.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -256,28 +256,20 @@ def post(self):
256256
return time_entries_dao.create(ns.payload), HTTPStatus.CREATED
257257

258258

259-
# TODO: Once this endpoint is working as expected in prod, review and
260-
# remove unnecessary filter args. As we are using same attributes_filter
261-
# as the get_all endpoint and some of the args are unnecessary for this endpoint.
262-
263-
264259
@ns.route('/latest')
265260
class LatestTimeEntries(Resource):
266261
@ns.doc('list_latest_time_entries')
267-
@ns.expect(attributes_filter)
268262
@ns.marshal_list_with(time_entry)
269263
@ns.response(HTTPStatus.NOT_FOUND, 'Time entry not found')
270264
def get(self):
271265
"""List the latest time entries"""
272-
conditions = attributes_filter.parse_args()
273266

274-
return time_entries_dao.get_lastest_entries_by_project(
275-
conditions=conditions
276-
)
267+
return time_entries_dao.get_lastest_entries_by_project(conditions={})
277268

278269

279270
@ns.route('/<string:id>')
280271
@ns.response(HTTPStatus.NOT_FOUND, 'This time entry does not exist')
272+
@ns.response(HTTPStatus.UNPROCESSABLE_ENTITY, 'The id has an invalid format')
281273
@ns.param('id', 'The unique identifier of the time entry')
282274
class TimeEntry(Resource):
283275
@ns.doc('get_time_entry')

0 commit comments

Comments
 (0)