🐛 Fixed search
This commit is contained in:
@@ -13,8 +13,7 @@
|
|||||||
import { getLocalization } from '$lib/i18n';
|
import { getLocalization } from '$lib/i18n';
|
||||||
const { t } = getLocalization();
|
const { t } = getLocalization();
|
||||||
import SearchCard from '$lib/search-card.svelte';
|
import SearchCard from '$lib/search-card.svelte';
|
||||||
import { createQueryParamsStore } from '$lib/stores';
|
let search_term = '';
|
||||||
const search_term = createQueryParamsStore('q');
|
|
||||||
let resp_data = null;
|
let resp_data = null;
|
||||||
|
|
||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
@@ -24,7 +23,7 @@
|
|||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
q: $search_term,
|
q: search_term,
|
||||||
attributesToHighlight: ['*']
|
attributesToHighlight: ['*']
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
@@ -57,12 +56,12 @@
|
|||||||
placeholder={$t('search_page.at_least_3_characters')}
|
placeholder={$t('search_page.at_least_3_characters')}
|
||||||
aria-label="Search"
|
aria-label="Search"
|
||||||
aria-describedby="button-addon2"
|
aria-describedby="button-addon2"
|
||||||
bind:value={$search_term}
|
bind:value={search_term}
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
class="inline-block px-6 py-2.5 bg-blue-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-blue-700 hover:shadow-lg focus:bg-blue-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-800 active:shadow-lg transition duration-150 ease-in-out flex items-center disabled:opacity-50 disabled:cursor-not-allowed"
|
class="inline-block px-6 py-2.5 bg-blue-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-blue-700 hover:shadow-lg focus:bg-blue-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-800 active:shadow-lg transition duration-150 ease-in-out flex items-center disabled:opacity-50 disabled:cursor-not-allowed"
|
||||||
id="button-addon2"
|
id="button-addon2"
|
||||||
disabled={$search_term.length <= 2}
|
disabled={search_term.length <= 2}
|
||||||
type="submit"
|
type="submit"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
|
|||||||
Reference in New Issue
Block a user