Skip to content

Commit

Permalink
Kowalski filter auto-followup: don't edit original form (#538)
Browse files Browse the repository at this point in the history
make a copy of the allocation form before editing it to remove date parameters
  • Loading branch information
Theodlz authored Oct 23, 2023
1 parent 0fa27e9 commit 4d793d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extensions/skyportal/static/js/components/FilterPlugins.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,13 @@ const FilterPlugins = ({ group }) => {
if (!allocationLookUp[selectedAllocationId] || !instrumentFormParams) {
return;
}
const params = {
const existingParams = {
...instrumentFormParams[
allocationLookUp[selectedAllocationId].instrument_id
],
};
// we make a copy of the existing params so we don't modify the original
const params = Object.assign({}, existingParams);
// remove priority, start_date, and end_date if they exist in params.schema and params.uiSchema
const deleted = [];
if (params.formSchema) {
Expand Down

0 comments on commit 4d793d0

Please sign in to comment.