diff --git a/src/xo-mixins/resource-sets.js b/src/xo-mixins/resource-sets.js index bc358da2f..c383c304c 100644 --- a/src/xo-mixins/resource-sets.js +++ b/src/xo-mixins/resource-sets.js @@ -52,14 +52,14 @@ export default class { return set } - deleteResourceSet (id) { - return this._store.get(id).catch(error => { - if (error.notFound) { - throw new NoSuchResourceSet(id) - } + async deleteResourceSet (id) { + const store = this._store - throw error - }) + if (await store.has(id)) { + return store.del(id) + } + + throw new NoSuchResourceSet(id) } async updateResourceSet (id, { name, subjects, objects }) {