diff options
| author | yxshv <[email protected]> | 2024-04-14 14:57:22 +0530 |
|---|---|---|
| committer | yxshv <[email protected]> | 2024-04-14 14:57:22 +0530 |
| commit | fef159cdcb1d369d9cd95ec4efb74fbb4669a685 (patch) | |
| tree | 721f45263b6d06e432b4406dea6e9c517f1c0ea3 /apps/web/src/actions | |
| parent | update routes (diff) | |
| download | supermemory-fef159cdcb1d369d9cd95ec4efb74fbb4669a685.tar.xz supermemory-fef159cdcb1d369d9cd95ec4efb74fbb4669a685.zip | |
fix
Diffstat (limited to 'apps/web/src/actions')
| -rw-r--r-- | apps/web/src/actions/db.ts | 11 |
1 files changed, 8 insertions, 3 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), |