add project deletion in storage & connect to ip port 3000

This commit is contained in:
Ishaan Dey
2024-05-23 23:05:01 -07:00
parent 218afd4fe0
commit 1528ea5257
5 changed files with 32 additions and 39 deletions

View File

@ -52,6 +52,14 @@ export default {
const id = params.get("id") as string;
await db.delete(usersToSandboxes).where(eq(usersToSandboxes.sandboxId, id));
await db.delete(sandbox).where(eq(sandbox.id, id));
const deleteStorageRequest = new Request("https://storage.ishaan1013.workers.dev/api/project", {
method: "DELETE",
body: JSON.stringify({ sandboxId: id }),
headers: { "Content-Type": "application/json" },
});
const deleteStorageRes = await env.STORAGE.fetch(deleteStorageRequest);
return success;
} else {
return invalidRequest;
@ -93,7 +101,7 @@ export default {
});
const initStorageRes = await env.STORAGE.fetch(initStorageRequest);
const initStorage = await initStorageRes.text();
// const initStorage = await initStorageRes.text();
return new Response(sb.id, { status: 200 });
} else {