Describe the bug
This bug happens when the frontend API calls GET /detections/summary before GET /detections. You will not get any other attributes from other tables.
To Reproduce
Steps to reproduce the behavior:
call GET /detections/summary (please give authorization header for it to work)
call GET /detections with the same query parameters as the previous API call.
The detections API will not return key classification in all of the objects inside of the response array.
The opts.include in-place modification somehow makes it applies those changes to other functions as well. I will make those use a map instead so we get a new object every time we call. Also I will be adding checks to the GET /detections test suite as well.
Describe the bug This bug happens when the frontend API calls
GET /detections/summary
beforeGET /detections
. You will not get any other attributes from other tables.To Reproduce Steps to reproduce the behavior:
classification
in all of the objects inside of the response array.Expected behavior All keys should work as normal.
Additional context I think the problem is here https://github.com/rfcx/rfcx-api/blob/3489d50603eb4f336741cdbf3030f50dd210611d/core/detections/dao/index.js#L276-L280
The
opts.include
in-place modification somehow makes it applies those changes to other functions as well. I will make those use amap
instead so we get a new object every time we call. Also I will be adding checks to theGET /detections
test suite as well.