dashboard ui

This commit is contained in:
Ishaan Dey
2024-05-17 23:54:34 -07:00
parent 14ea89d690
commit bf35c2bf82
6 changed files with 61 additions and 56 deletions

View File

@ -62,32 +62,32 @@ export function addNew(
}
}
export async function startServer(
sandboxId: string,
userId: string,
callback: (success: boolean) => void
) {
try {
const res = await fetch("http://localhost:4001/start", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
sandboxId,
userId,
}),
});
// export async function startServer(
// sandboxId: string,
// userId: string,
// callback: (success: boolean) => void
// ) {
// try {
// const res = await fetch("http://localhost:4001/start", {
// method: "POST",
// headers: {
// "Content-Type": "application/json",
// },
// body: JSON.stringify({
// sandboxId,
// userId,
// }),
// });
if (res.status !== 200) {
console.error("Failed to start server", res);
callback(false);
}
// if (res.status !== 200) {
// console.error("Failed to start server", res);
// callback(false);
// }
callback(true);
} catch (error) {
console.error("Failed to start server", error);
// callback(true);
// } catch (error) {
// console.error("Failed to start server", error);
callback(false);
}
}
// callback(false);
// }
// }