diff --git a/frontend/src/routes/search/Search.svelte b/frontend/src/routes/search/Search.svelte
index 99aadba..a5f3d31 100644
--- a/frontend/src/routes/search/Search.svelte
+++ b/frontend/src/routes/search/Search.svelte
@@ -13,6 +13,7 @@
let fulltext = false;
let key = $state(router.getQueryParam('key'));
let input = $state(router.getQueryParam('key'));
+ let projects = $state(null);
let tasks = $state(null);
async function setKey(ev){
@@ -38,6 +39,7 @@
body: JSON.stringify(data)
};
fetch(api('bookmark/search'),options).then(handleBookmarks);
+ fetch(api('project/search'),options).then(handleProjects);
fetch(api('task/search'),options).then(handleTasks);
}
@@ -55,6 +57,15 @@
}
}
+ async function handleProjects(resp){
+ if (resp.ok){
+ const res = await resp.json();
+ projects = Object.keys(res).length ? res : null;
+ } else {
+ error = await resp.text();
+ }
+ }
+
async function handleTasks(resp){
if (resp.ok){
const res = await resp.json();
@@ -85,6 +96,20 @@
+{#if projects}
+
+{/if}
{#if tasks}