Skip to content

Commit

Permalink
Fixed a couple bugs with passing api_call_group_id to backend
Browse files Browse the repository at this point in the history
  • Loading branch information
Sigfried committed Nov 14, 2023
1 parent 832a851 commit f720daf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion backend/api_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async def start_rpt(self, request: Request, params: Dict):

rpt['schema'] = get_schema_name()

rpt['api_call_group_id'] = int(request.query_params.get('api_call_group_id'))
rpt['api_call_group_id'] = int(request.query_params.get('api_call_group_id', -1))

rpt_params = {}
for k,v in params.items():
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/state/DataGetter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ class DataGetter {
} else {
if (useGetForSmallData && data.length <= 1000) {
request.method = 'get';
qs = makeQueryString(data);
qs = makeQueryString(data).toString();
} else {
request.method = 'post';
request.data = data;
}
}
qs = qs.length ? qs : qs + '&api_call_group_id=' + this.api_call_group_id
qs = qs.length ? qs + '&' : qs;
qs = qs + 'api_call_group_id=' + this.api_call_group_id
request.url = url + '?' + qs;

verbose && console.log("axios request", request);
Expand Down Expand Up @@ -270,7 +271,7 @@ class DataGetter {
expectedParams: [], // concept_ids
api: 'codeset-ids-by-concept-id',
apiGetParamName: 'concept_ids',
makeQueryString: concept_ids => createSearchParams({concept_ids}),
makeQueryString: concept_ids => createSearchParams({concept_ids: concept_ids}),
protocols: ['get', 'post'],
cacheSlice: 'codeset_ids_by_concept_id',
key: 'concept_id',
Expand All @@ -281,7 +282,7 @@ class DataGetter {
expectedParams: [], // codeset_ids
api: 'concept-ids-by-codeset-id',
apiGetParamName: 'codeset_ids',
makeQueryString: codeset_ids => createSearchParams({codeset_ids}),
makeQueryString: codeset_ids => createSearchParams({codeset_ids: codeset_ids}),
protocols: ['get', 'post'],
cacheSlice: 'codeset_ids_by_concept_id',
key: 'codeset_id',
Expand Down

0 comments on commit f720daf

Please sign in to comment.