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.
30 lines
630 B
JavaScript
30 lines
630 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} |