diff --git a/src/resources/table_endpoints/table_endpoints.py b/src/resources/table_endpoints/table_endpoints.py index a30463bf..36b68fff 100644 --- a/src/resources/table_endpoints/table_endpoints.py +++ b/src/resources/table_endpoints/table_endpoints.py @@ -1,7 +1,8 @@ from flask_restful import Resource from common.database_helpers import get_investigations_for_user, get_investigations_for_user_count, \ - get_facility_cycles_for_instrument, get_facility_cycles_for_instrument_count + get_facility_cycles_for_instrument, get_facility_cycles_for_instrument_count, \ + get_investigations_for_instrument_in_facility_cycle, get_investigations_for_instrument_in_facility_cycle_count from common.helpers import requires_session_id, queries_records, get_filters_from_query_string @@ -34,9 +35,15 @@ def get(self, id): class InstrumentsFacilityCyclesInvestigations(Resource): - pass + @requires_session_id + @queries_records + def get(self, instrument_id, cycle_id): + return list(map(lambda x: x.to_dict(), get_investigations_for_instrument_in_facility_cycle(instrument_id, cycle_id))), 200 class InstrumentsFacilityCyclesInvestigationsCount(Resource): - pass + @requires_session_id + @queries_records + def get(self, instrument_id, cycle_id): + return get_investigations_for_instrument_in_facility_cycle_count(instrument_id, cycle_id), 200