Commit 3969dedf authored by Samir Sadyhov's avatar Samir Sadyhov 🤔

fix UTILS.getPageParamValue

parent 21450480
...@@ -44,8 +44,9 @@ UTILS.changeLabel = (id, ru, kk, en = ru) => fire({type: 'change_label', text: l ...@@ -44,8 +44,9 @@ UTILS.changeLabel = (id, ru, kk, en = ru) => fire({type: 'change_label', text: l
UTILS.getPageParamValue = paramName => { UTILS.getPageParamValue = paramName => {
const {paramValues, params, pageParams} = Cons.getCurrentPage(); const {paramValues, params, pageParams} = Cons.getCurrentPage();
const paramID = params.find(x => x.name == paramName).id; const param = params.find(x => x.name == paramName);
return paramValues.find(x => x.pageParamID == paramID || x.pageParamName == paramName).value; if(!param || !param.hasOwnProperty('id')) return null;
return paramValues.find(x => x.pageParamID == param.id || x.pageParamName == paramName)?.value || null;
} }
UTILS.formatDate = function(datetime, time) { UTILS.formatDate = function(datetime, time) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment