added user status and prediction user
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
const axios = require('axios');
|
||||
|
||||
|
||||
const host = 'http://localhost:3000';
|
||||
// const host = 'https://definma-api.apps.de1.bosch-iot-cloud.com';
|
||||
// const host = 'http://localhost:3000';
|
||||
const host = 'https://definma-api.apps.de1.bosch-iot-cloud.com';
|
||||
|
||||
let errors = [];
|
||||
|
||||
@ -22,7 +22,7 @@ async function fix() {
|
||||
});
|
||||
console.log(res.data);
|
||||
// for all samples
|
||||
for (let sampleIndex in res.data) {
|
||||
for (let sampleIndex = 2000; sampleIndex < res.data.length; sampleIndex++) {
|
||||
console.log(`SAMPLE ${sampleIndex}/${res.data.length}`);
|
||||
const measurements = await axios({ // get all measurements
|
||||
method: 'get',
|
||||
@ -42,7 +42,7 @@ async function fix() {
|
||||
for (let measurementIndex in measurements.data) {
|
||||
console.log(`${measurementIndex}/${measurements.data.length}`);
|
||||
const measurement = measurements.data[measurementIndex];
|
||||
if (measurement.values.hasOwnProperty('dpt')) { // is spectrum
|
||||
if (measurement.values.hasOwnProperty('dpt') && measurement.values.dpt) { // is spectrum
|
||||
await axios({ // get all measurements
|
||||
method: 'put',
|
||||
url: host + '/measurement/' + measurement._id,
|
||||
|
Reference in New Issue
Block a user