Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init empty array for List experiments response #55

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

krithika369
Copy link
Collaborator

@krithika369 krithika369 commented Dec 16, 2022

What this PR does / why we need it: This is a minor bugfix for the List Experiments API when 0 records are selected from the DB. We subsequently iterate over the experiments and copy only the required fields (specified by the field selector, if set), to a new array. However, this array was previously uninitialised, leading to "data": null as opposed to "data": [] in the response. (This is implemented correctly for other entities like Segments and Treatments already.)

@krithika369 krithika369 marked this pull request as draft December 16, 2022 03:41
@krithika369 krithika369 marked this pull request as ready for review December 16, 2022 04:10
@krithika369 krithika369 merged commit 33fb83b into caraml-dev:main Dec 16, 2022
@krithika369 krithika369 deleted the empty_experiments_bugfix branch December 16, 2022 04:20
@krithika369
Copy link
Collaborator Author

Thanks for the quick review @terryyylim !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants