code cleanup
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import {t} from '../../translations.svelte.js';
|
||||
|
||||
let key = "";
|
||||
import { t } from '../../translations.svelte.js';
|
||||
|
||||
let fulltext = false;
|
||||
let html = "";
|
||||
let html = "";
|
||||
let key = "";
|
||||
|
||||
async function doSearch(ev){
|
||||
if (ev) ev.preventDefault();
|
||||
const url = `${location.protocol}//${location.host.replace('5173','8080')}/legacy/search`;
|
||||
const url = `${location.protocol}//${location.host.replace('5173','8080')}/legacy/search`;
|
||||
const resp = await fetch(url,{
|
||||
credentials:'include',
|
||||
method : 'POST',
|
||||
body: JSON.stringify({key:key,fulltext:fulltext?'on':'off'})
|
||||
credentials : 'include',
|
||||
method : 'POST',
|
||||
body : JSON.stringify({key:key,fulltext:fulltext?'on':'off'})
|
||||
});
|
||||
if (resp.ok){
|
||||
html = await resp.text();
|
||||
@@ -22,7 +23,7 @@
|
||||
|
||||
onMount(() => {
|
||||
let params = new URLSearchParams(location.search);
|
||||
key = params.get('key');
|
||||
key = params.get('key');
|
||||
if (key) doSearch();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user