Fixed eslint
This commit is contained in:
parent
fbf1cc6aab
commit
addbf88c4c
2 changed files with 18 additions and 18 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
/* eslint-disable class-methods-use-this */
|
||||||
import FilteredSearchContainer from '../filtered_search/container';
|
import FilteredSearchContainer from '../filtered_search/container';
|
||||||
|
|
||||||
export default class FilteredSearchBoards extends gl.FilteredSearchManager {
|
export default class FilteredSearchBoards extends gl.FilteredSearchManager {
|
||||||
|
|
|
@ -1,22 +1,21 @@
|
||||||
export default (path, extraData) => {
|
export default (path, extraData) => path.split('&').reduce((dataParam, filterParam) => {
|
||||||
return path.split('&').reduce((data, filterParam) => {
|
if (filterParam === '') return dataParam;
|
||||||
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, ' ');
|
|
||||||
|
|
||||||
if (isArray !== -1) {
|
const data = dataParam;
|
||||||
if (!data[paramKeyNormalized]) {
|
const paramSplit = filterParam.split('=');
|
||||||
data[paramKeyNormalized] = [];
|
const paramKeyNormalized = paramSplit[0].replace('[]', '');
|
||||||
}
|
const isArray = paramSplit[0].indexOf('[]');
|
||||||
|
const value = decodeURIComponent(paramSplit[1]).replace(/\+/g, ' ');
|
||||||
|
|
||||||
data[paramKeyNormalized].push(value);
|
if (isArray !== -1) {
|
||||||
} else {
|
if (!data[paramKeyNormalized]) {
|
||||||
data[paramKeyNormalized] = value;
|
data[paramKeyNormalized] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
data[paramKeyNormalized].push(value);
|
||||||
}, extraData);
|
} else {
|
||||||
}
|
data[paramKeyNormalized] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}, extraData);
|
||||||
|
|
Loading…
Reference in a new issue