aboutsummaryrefslogtreecommitdiff
path: root/apps/web/src
diff options
context:
space:
mode:
authoryxshv <[email protected]>2024-04-14 14:57:22 +0530
committeryxshv <[email protected]>2024-04-14 14:57:22 +0530
commitfef159cdcb1d369d9cd95ec4efb74fbb4669a685 (patch)
tree721f45263b6d06e432b4406dea6e9c517f1c0ea3 /apps/web/src
parentupdate routes (diff)
downloadsupermemory-fef159cdcb1d369d9cd95ec4efb74fbb4669a685.tar.xz
supermemory-fef159cdcb1d369d9cd95ec4efb74fbb4669a685.zip
fix
Diffstat (limited to 'apps/web/src')
-rw-r--r--apps/web/src/actions/db.ts11
-rw-r--r--apps/web/src/components/Main.tsx3
2 files changed, 10 insertions, 4 deletions
diff --git a/apps/web/src/actions/db.ts b/apps/web/src/actions/db.ts
index d6c3cc5e..4e14d957 100644
--- a/apps/web/src/actions/db.ts
+++ b/apps/web/src/actions/db.ts
@@ -424,7 +424,7 @@ export async function updateMemory(
console.log("adding with:", `${updated.url}-${user.email}`)
// Add to vectorDB
const res = (await Promise.race([
- fetch("https://cf-ai-backend.dhravya.workers.dev/edit?uniqueUrl="+updated.url , {
+ fetch("https://cf-ai-backend.dhravya.workers.dev/edit", {
method: "POST",
headers: {
"X-Custom-Auth-Key": env.BACKEND_SECURITY_KEY,
@@ -434,6 +434,7 @@ export async function updateMemory(
title: updated.title,
url: updated.url,
user: user.email,
+ uniqueUrl: updated.url,
}),
}),
new Promise((_, reject) =>
@@ -520,11 +521,15 @@ export async function deleteMemory(id: number) {
console.log("adding with:", `${deleted.url}-${user.email}`)
const res = (await Promise.race([
- fetch(`https://cf-ai-backend.dhravya.workers.dev/delete?websiteUrl=${deleted.url}&user=${user.email}` , {
+ fetch(`https://cf-ai-backend.dhravya.workers.dev/delete` , {
method: "DELETE",
headers: {
"X-Custom-Auth-Key": env.BACKEND_SECURITY_KEY,
- }
+ },
+ body: JSON.stringify({
+ websiteUrl: deleted.url,
+ user: user.email
+ })
}),
new Promise((_, reject) =>
setTimeout(() => reject(new Error("Request timed out")), 40000),
diff --git a/apps/web/src/components/Main.tsx b/apps/web/src/components/Main.tsx
index df6a08bf..68ee8d9f 100644
--- a/apps/web/src/components/Main.tsx
+++ b/apps/web/src/components/Main.tsx
@@ -185,7 +185,8 @@ export default function Main({ sidebarOpen }: { sidebarOpen: boolean }) {
}),
},
);
-
+
+ console.log("sources", sourcesResponse)
const sourcesInJson = getIdsFromSource(((await sourcesResponse.json()) as {
ids: string[]