Add missing APIs to legacy persistence adapter (#3433)

* Sends new style object to the object API for save when calling it from legacy persistence adapter

* Adds createObject and deleteObject methods to LegacyPersistenceAdapter
This commit is contained in:
Shefali Joshi 2020-10-08 10:45:06 -07:00 committed by GitHub
parent a192d46c2b
commit 631876cab3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,6 +35,24 @@ export default class LegacyPersistenceAdapter {
return Promise.resolve(Object.keys(this.openmct.objects.providers));
}
createObject(space, key, legacyDomainObject) {
let object = utils.toNewFormat(legacyDomainObject, {
namespace: space,
key: key
});
return this.openmct.objects.save(object);
}
deleteObject(space, key) {
const identifier = {
namespace: space,
key: key
};
return this.openmct.objects.delete(identifier);
}
updateObject(space, key, legacyDomainObject) {
let object = utils.toNewFormat(legacyDomainObject, {
namespace: space,