Skip to content

Commit

Permalink
#34: Add final resources
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Aug 29, 2019
1 parent c709dd6 commit cfc9b8d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/resources/table_endpoints/table_endpoints.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down Expand Up @@ -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

0 comments on commit cfc9b8d

Please sign in to comment.