resourceSet: fix deletion.

This commit is contained in:
Julien Fontanet 2016-02-17 15:01:12 +01:00
parent c2d4423720
commit 1aedf9bb07

View File

@ -52,14 +52,14 @@ export default class {
return set return set
} }
deleteResourceSet (id) { async deleteResourceSet (id) {
return this._store.get(id).catch(error => { const store = this._store
if (error.notFound) {
throw new NoSuchResourceSet(id)
}
throw error if (await store.has(id)) {
}) return store.del(id)
}
throw new NoSuchResourceSet(id)
} }
async updateResourceSet (id, { name, subjects, objects }) { async updateResourceSet (id, { name, subjects, objects }) {