debian-mirror-gitlab/app/assets/javascripts/search/sidebar/utils.js
2023-05-27 22:25:52 +05:30

17 lines
441 B
JavaScript

import { languageFilterData } from '~/search/sidebar/constants/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: {} },
);