refactor: Update 'deleteHostSet' to use hostset's id
This commit is contained in:
3 files changed
+5
-5
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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');
|
||||
|
||||
Reference in new issue
Block a user