Delete measurement

This commit is contained in:
Matthew Dillon 2015-11-10 16:14:02 -07:00
parent b2fa171d17
commit c1ff0d57b4
7 changed files with 28 additions and 7 deletions

View file

@ -8,8 +8,12 @@ export default Component.extend({
allCharacteristics: null,
measurement: null,
// Actions
"save-measurement": null,
"delete-measurement": null,
oldCharacteristicId: function() {
let json = this.get('measurement').toJSON();
const json = this.get('measurement').toJSON();
return json.characteristic;
}.property(),
@ -29,12 +33,8 @@ export default Component.extend({
},
delete: function() {
let char = this.get('measurement.characteristic');
if (char.get('isNew')) {
char.destroyRecord();
}
this.get('measurement').destroyRecord();
}
this.attrs['delete-measurement'](this.get('measurement'));
},
},
});