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:
parent
060c08b5e3
commit
c02634351b
1 changed files with 23 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue