Skip to content

Commit

Permalink
fix(telecom.sms): fix issue with index if data grid is sorted (#9879)
Browse files Browse the repository at this point in the history
ref: DTRSD-117586

Signed-off-by: Guillaume Hyenne <[email protected]>
  • Loading branch information
ghyenne authored Aug 28, 2023
1 parent 64cc370 commit 0169238
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import angular from 'angular';
import isEqual from 'lodash/isEqual';
import get from 'lodash/get';
import pull from 'lodash/pull';

Expand Down Expand Up @@ -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 = [];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import angular from 'angular';
import remove from 'lodash/remove';
import isEqual from 'lodash/isEqual';

export default class {
/* @ngInject */
Expand Down Expand Up @@ -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([
Expand Down

0 comments on commit 0169238

Please sign in to comment.