summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/search/index.js
blob: 781a564d07731925adce7388aa3c2742ffa550e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { queryToObject } from '~/lib/utils/url_utility';
import createStore from './store';
import { initSidebar } from './sidebar';
import initGroupFilter from './group_filter';

export const initSearchApp = () => {
  // Similar to url_utility.decodeUrlParameter
  // Our query treats + as %20.  This replaces the query + symbols with %20.
  const sanitizedSearch = window.location.search.replace(/\+/g, '%20');
  const store = createStore({ query: queryToObject(sanitizedSearch) });

  initSidebar(store);
  initGroupFilter(store);
};