Add search view

This commit is contained in:
2023-05-25 17:06:17 +02:00
parent fff705bc2a
commit 9e5f2ae6d4
5 changed files with 289 additions and 66 deletions

View File

@@ -82,3 +82,15 @@ export const fs_delete_all = async (bucket, path) => {
throw new Error(await resp.text())
}
}
export const fs_search = async (bucket, path, term, limit = 10) => {
const resp = await fetch(
fs_path_url(bucket, path) +
"?search=" + encodeURIComponent(term) +
"&limit=" + limit
)
if (resp.status >= 400) {
throw await resp.text()
}
return resp.json()
}