diff --git a/packages/manager/modules/sms/src/sms/options/response/edit/telecom-sms-options-response-edit.controller.js b/packages/manager/modules/sms/src/sms/options/response/edit/telecom-sms-options-response-edit.controller.js index f7509c3623d0..bb6b5eddb261 100644 --- a/packages/manager/modules/sms/src/sms/options/response/edit/telecom-sms-options-response-edit.controller.js +++ b/packages/manager/modules/sms/src/sms/options/response/edit/telecom-sms-options-response-edit.controller.js @@ -1,4 +1,5 @@ import angular from 'angular'; +import isEqual from 'lodash/isEqual'; import get from 'lodash/get'; import pull from 'lodash/pull'; @@ -41,7 +42,9 @@ export default class { this.model = { service: angular.copy(this.service), senders: angular.copy(this.senders), - index: this.index, + index: this.service.smsResponse.trackingOptions.findIndex((value) => + isEqual(value, this.option), + ), option: angular.copy(this.option), }; this.availableTrackingMedia = []; diff --git a/packages/manager/modules/sms/src/sms/options/response/remove/telecom-sms-options-response-remove.controller.js b/packages/manager/modules/sms/src/sms/options/response/remove/telecom-sms-options-response-remove.controller.js index 370312b589d8..d4fa5508b6e1 100644 --- a/packages/manager/modules/sms/src/sms/options/response/remove/telecom-sms-options-response-remove.controller.js +++ b/packages/manager/modules/sms/src/sms/options/response/remove/telecom-sms-options-response-remove.controller.js @@ -1,5 +1,6 @@ import angular from 'angular'; import remove from 'lodash/remove'; +import isEqual from 'lodash/isEqual'; export default class { /* @ngInject */ @@ -45,9 +46,8 @@ export default class { */ remove() { this.loading.removeTrackingOption = true; - remove( - this.model.service.smsResponse.trackingOptions, - this.model.service.smsResponse.trackingOptions[this.model.index], + remove(this.model.service.smsResponse.trackingOptions, (value) => + isEqual(value, this.model.option), ); return this.$q .all([