sql schema update + start share logic

This commit is contained in:
Ishaan Dey
2024-05-01 01:29:16 -04:00
parent c171cb580e
commit 66a76eb0f9
13 changed files with 294 additions and 82 deletions

View File

@ -42,3 +42,20 @@ export async function deleteSandbox(id: string) {
revalidatePath("/dashboard")
}
export async function shareSandbox(sandboxId: string, email: string) {
try {
const res = await fetch("http://localhost:8787/api/sandbox/share", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ sandboxId, email }),
})
revalidatePath(`/code/${sandboxId}`)
return true
} catch (err) {
return false
}
}