refactor: Update 'deleteHostSet' to use hostset's id

This commit is contained in:
Susmitha Girumala committed 2020-08-27 15:21:40 -04:00
1 parent f97eebe1b8
commit 9725362d05
3 files changed
+5 -5

No files matched your search

+3 -3
View File
@@ -81,12 +81,12 @@ export default class TargetModel extends GeneratedTargetModel {
/**
* Delete a single host set via the `delete-host-sets` method.
* @param {object} hostSet
* @param {number} hostSetID
* @param {object} options
* @return {Promise}
*/
deleteHostSet(hostSet, options) {
return this.deleteHostSets([hostSet.id], options);
deleteHostSet(hostSetID, options) {
return this.deleteHostSets([hostSetID], options);
}
}
+1 -1
View File
@@ -153,6 +153,6 @@ module('Unit | Model | target', function (hooks) {
}
});
const model = store.peekRecord('target', '123abc');
await model.deleteHostSet({id: '3'});
await model.deleteHostSet('3');
});
});
@@ -59,7 +59,7 @@ export default class ScopesScopeProjectsProjectTargetsTargetHostSetsRoute extend
@action
async delete(target, hostSet) {
try {
await target.deleteHostSet(hostSet);
await target.deleteHostSet(hostSet.id);
this.refresh();
this.notify.success(this.intl.t('notify.delete-success'));
this.transitionTo('scopes.scope.projects.project.targets.target.host-sets');