13 lines
534 B
TypeScript
13 lines
534 B
TypeScript
|
|
import type { FontshareParams } from '$entities/Font';
|
||
|
|
import type { FilterManager } from '../filterManager/filterManager.svelte';
|
||
|
|
|
||
|
|
export function mapManagerToParams(manager: FilterManager): Partial<FontshareParams> {
|
||
|
|
return {
|
||
|
|
q: manager.debouncedQueryValue,
|
||
|
|
// Map groups to specific API keys
|
||
|
|
categories: manager.getGroup('categories')?.instance.selectedProperties.map(p => p.value)
|
||
|
|
?? [],
|
||
|
|
tags: manager.getGroup('tags')?.instance.selectedProperties.map(p => p.value) ?? [],
|
||
|
|
};
|
||
|
|
}
|