From 7ec6f9e6d03cda422ea58251cdd647947a3a17fa Mon Sep 17 00:00:00 2001 From: root Date: Wed, 14 Aug 2019 14:25:07 +0200 Subject: [PATCH 1/2] Report CUD fix --- client/src/reports/CUD.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/reports/CUD.js b/client/src/reports/CUD.js index 4fe89ab9..3757864d 100644 --- a/client/src/reports/CUD.js +++ b/client/src/reports/CUD.js @@ -98,7 +98,7 @@ export default class CUD extends Component { description: '', report_template: null, namespace: getDefaultNamespace(this.props.permissions), - user_fields: null + user_fields: [] }); } } From 70ca9f405a846efb474aaaf7607c31f7912328fc Mon Sep 17 00:00:00 2001 From: root Date: Wed, 14 Aug 2019 15:13:27 +0200 Subject: [PATCH 2/2] fix --- client/src/reports/CUD.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/src/reports/CUD.js b/client/src/reports/CUD.js index 3757864d..3a34ec52 100644 --- a/client/src/reports/CUD.js +++ b/client/src/reports/CUD.js @@ -78,9 +78,11 @@ export default class CUD extends Component { submitFormValuesMutator(data) { const params = {}; - for (const spec of data.user_fields) { - const fldId = `param_${spec.id}`; - params[spec.id] = data[fldId]; + if(data.user_fields){ + for (const spec of data.user_fields) { + const fldId = `param_${spec.id}`; + params[spec.id] = data[fldId]; + } } data.params = params; @@ -98,7 +100,7 @@ export default class CUD extends Component { description: '', report_template: null, namespace: getDefaultNamespace(this.props.permissions), - user_fields: [] + user_fields: null }); } }