You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
602 B
JavaScript
28 lines
602 B
JavaScript
import { logger } from "./log.js";
|
|
|
|
function checkScene(scene) {
|
|
const req = new Request(`/checkscene?scene=${scene}`);
|
|
let init = {
|
|
method: "GET",
|
|
//body: JSON.stringify({"points": data})
|
|
};
|
|
// we defined the xhr
|
|
|
|
return fetch(req, init)
|
|
.then((response) => {
|
|
if (!response.ok) {
|
|
throw new Error(`HTTP error! status: ${response.status}`);
|
|
} else {
|
|
return response.json();
|
|
}
|
|
})
|
|
.then((ret) => {
|
|
logger.setErrorsContent(ret);
|
|
})
|
|
.catch((reject) => {
|
|
console.log("error check scene!");
|
|
});
|
|
}
|
|
|
|
export { checkScene };
|