[questions][fix] fix landing page company param (#477)
parent
a208435dad
commit
fac7d6c48d
@ -0,0 +1,18 @@
|
||||
import type {
|
||||
FilterChoice,
|
||||
FilterOption,
|
||||
} from '~/components/questions/filter/FilterSection';
|
||||
|
||||
export function companyOptionToSlug(option: FilterChoice): string {
|
||||
return `${option.id}_${option.label}`;
|
||||
}
|
||||
|
||||
export function slugToCompanyOption(slug: string): FilterOption {
|
||||
const [id, label] = slug.split('_');
|
||||
return {
|
||||
checked: true,
|
||||
id,
|
||||
label,
|
||||
value: id,
|
||||
};
|
||||
}
|
Loading…
Reference in new issue