[Persistence] Use ids from TransactionManager API

Recommended during code review,
https://github.com/nasa/openmct/pull/1084#discussion_r71021889
This commit is contained in:
Victor Woeltjen
2016-07-15 12:23:33 -07:00
parent 550e60455b
commit eb6ddb5e45
4 changed files with 31 additions and 33 deletions

View File

@ -60,7 +60,7 @@ define(
if (this.transactionManager.isActive()) {
this.transactionManager.addToTransaction(
this.domainObject,
this.domainObject.getId(),
wrappedPersistence.persist.bind(wrappedPersistence),
wrappedPersistence.refresh.bind(wrappedPersistence)
);
@ -72,7 +72,8 @@ define(
};
TransactionalPersistenceCapability.prototype.refresh = function () {
this.transactionManager.clearTransactionsFor(this.domainObject);
this.transactionManager
.clearTransactionsFor(this.domainObject.getId());
return this.persistenceCapability.refresh();
};