Commit bc7097af authored by Bryce Johnson's avatar Bryce Johnson

Simplify modifyUrlParams to fix bugs with extra tokens.

parent 7738b819
...@@ -12,13 +12,17 @@ export default class FilteredSearchServiceDesk extends gl.FilteredSearchManager ...@@ -12,13 +12,17 @@ export default class FilteredSearchServiceDesk extends gl.FilteredSearchManager
} }
modifyUrlParams(paramsArray) { modifyUrlParams(paramsArray) {
const paramKey = 'author_username'; const authorParamKey = 'author_username';
// FIXME: Need to grab the value from a data attribute // FIXME: Need to grab the value from a data attribute
const supportBotParamPair = `${paramKey}=support-bot`; const supportBotParamPair = `${authorParamKey}=support-bot`;
return paramsArray.map((param) => { const onlyValidParams = paramsArray.filter((param) => {
return param.indexOf(paramKey) === -1 ? param : supportBotParamPair; return param.indexOf(authorParamKey) === -1;
}); });
onlyValidParams.push(supportBotParamPair);
return onlyValidParams;
} }
} }
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