dashboard ui
This commit is contained in:
@ -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);
|
||||
// }
|
||||
// }
|
||||
|
Reference in New Issue
Block a user