feat: better layout in a lot of places

This commit is contained in:
2023-08-02 01:58:03 +02:00
parent ff3e7f6667
commit 3cfa2274a8
23 changed files with 208 additions and 110 deletions

View File

@@ -25,7 +25,7 @@ export async function getDocuments(): Promise<Document[]> {
const headers = new Headers();
headers.append("Accept", "application/json");
console.log("[documents] fetching all documents");
const response = await fetch(`${SILVERBULLET_SERVER}/index.json`, {
headers: headers,
});
@@ -47,6 +47,8 @@ export function createDocument(
headers.append("Content-Type", mediaType);
}
console.log("[documents] creating document", { name });
return fetch(SILVERBULLET_SERVER + "/" + name, {
body: content,
method: "PUT",
@@ -58,6 +60,7 @@ export async function getDocument(name: string): Promise<string> {
const cachedDocument = await cache.getDocument(name);
if (cachedDocument) return cachedDocument;
console.log("[documents] fetching document", { name });
const response = await fetch(SILVERBULLET_SERVER + "/" + name);
const text = await response.text();