1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00

Fix not saving simulator IDs in nodes

This commit is contained in:
Markus Grigull 2017-08-14 22:12:41 +02:00
parent 060c08b5e3
commit c02634351b

View file

@ -64,6 +64,29 @@ class NodesDataManager extends RestDataManager {
});
});
}
update(object, token = null) {
var obj = {};
obj[this.type] = this.filterKeys(object);
// filter simulator IDs
obj[this.type].simulators = obj[this.type].simulators.map(simulator => {
delete simulator.id;
return simulator;
});
RestAPI.put(this.makeURL(this.url + '/' + object._id), obj, token).then(response => {
AppDispatcher.dispatch({
type: this.type + 's/edited',
data: Object.assign({}, object, response[this.type])
});
}).catch(error => {
AppDispatcher.dispatch({
type: this.type + 's/edit-error',
error: error
});
});
}
}
export default new NodesDataManager();