Skip to content

Commit

Permalink
Merge pull request #36 from dinesh-aot/fix
Browse files Browse the repository at this point in the history
retrieve deactivated case files also
  • Loading branch information
nitheesh-aot authored Aug 26, 2024
2 parents dd293e5 + e7c72cd commit 2909c7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions compliance-api/src/compliance_api/resources/case_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class CaseFiles(Resource):
@auth.require
def get():
"""Fetch all casefiles."""
case_files = CaseFileService.get_all_case_files()
case_files = CaseFileService.get_all_case_files(default_filters=False)
case_file_list_schema = CaseFileSchema(many=True)
return case_file_list_schema.dump(case_files), HTTPStatus.OK

Expand Down Expand Up @@ -136,5 +136,7 @@ def get(case_file_number):
"""Fetch a CaseFile by number."""
case_file = CaseFileService.get_case_file_by_file_number(case_file_number)
if not case_file:
raise ResourceNotFoundError(f"CaseFile with case file number {case_file_number} not found")
raise ResourceNotFoundError(
f"CaseFile with case file number {case_file_number} not found"
)
return CaseFileSchema().dump(case_file), HTTPStatus.OK
4 changes: 2 additions & 2 deletions compliance-api/src/compliance_api/services/case_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ def get_initiation_options(cls):
return CaseFileInitiationOptionModel.get_all(sort_by="sort_order")

@classmethod
def get_all_case_files(cls):
def get_all_case_files(cls, default_filters=True):
"""Return all the case files."""
return CaseFileModel.get_all()
return CaseFileModel.get_all(default_filters)

@classmethod
def get_case_file_by_id(cls, case_file_id: int):
Expand Down

0 comments on commit 2909c7e

Please sign in to comment.