diff options
author | Phil Hughes <me@iamphill.com> | 2017-03-15 14:23:43 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-03-16 11:42:41 +0300 |
commit | addbf88c4cb66e4288cb1387efc1c30047745879 (patch) | |
tree | e2b550018169af8df1de6d791b9e0073c8cfe5dc /app/assets/javascripts/boards/utils | |
parent | fbf1cc6aab74cff9a425e8b2118f19141bb516a5 (diff) |
Fixed eslint
Diffstat (limited to 'app/assets/javascripts/boards/utils')
-rw-r--r-- | app/assets/javascripts/boards/utils/query_data.js | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/app/assets/javascripts/boards/utils/query_data.js b/app/assets/javascripts/boards/utils/query_data.js index 94cb5fbff42..2cd3c146f11 100644 --- a/app/assets/javascripts/boards/utils/query_data.js +++ b/app/assets/javascripts/boards/utils/query_data.js @@ -1,22 +1,21 @@ -export default (path, extraData) => { - return path.split('&').reduce((data, filterParam) => { - if (filterParam === '') return data; - - const paramSplit = filterParam.split('='); - const paramKeyNormalized = paramSplit[0].replace('[]', ''); - const isArray = paramSplit[0].indexOf('[]'); - const value = decodeURIComponent(paramSplit[1]).replace(/\+/g, ' '); +export default (path, extraData) => path.split('&').reduce((dataParam, filterParam) => { + if (filterParam === '') return dataParam; - if (isArray !== -1) { - if (!data[paramKeyNormalized]) { - data[paramKeyNormalized] = []; - } + const data = dataParam; + const paramSplit = filterParam.split('='); + const paramKeyNormalized = paramSplit[0].replace('[]', ''); + const isArray = paramSplit[0].indexOf('[]'); + const value = decodeURIComponent(paramSplit[1]).replace(/\+/g, ' '); - data[paramKeyNormalized].push(value); - } else { - data[paramKeyNormalized] = value; + if (isArray !== -1) { + if (!data[paramKeyNormalized]) { + data[paramKeyNormalized] = []; } - return data; - }, extraData); -} + data[paramKeyNormalized].push(value); + } else { + data[paramKeyNormalized] = value; + } + + return data; +}, extraData); |