debian-mirror-gitlab/app/assets/javascripts/search/sidebar/utils.js
2023-06-20 00:43:36 +05:30

17 lines
442 B
JavaScript

import { languageFilterData } from '~/search/sidebar/components/language_filter/data';
export const convertFiltersData = (rawBuckets) =>
rawBuckets.reduce(
(acc, bucket) => ({
...acc,
filters: {
...acc.filters,
[bucket.key.toUpperCase()]: {
label: bucket.key,
value: bucket.key,
count: bucket.count,
},
},
}),
{ ...languageFilterData, filters: {} },
);