Skip to content

Commit

Permalink
UI-1979: Fixed an error when updating Main Number e911
Browse files Browse the repository at this point in the history
  • Loading branch information
JRMaitre committed Jan 11, 2016
1 parent efc303e commit 377fa50
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions submodules/myOffice/myOffice.js
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ define(function(require){
});
});
},
setCallerId = function () {
setNumberData = function (e911Data) {
var callerIdName = callerIdNameInput.val();

account.caller_id = $.extend(true, {}, account.caller_id, {
Expand All @@ -910,6 +910,12 @@ define(function(require){
delete numberData.cnam;
}

if(e911Data) {
$.extend(true, numberData, {
dash_e911: e911Data
});
}

self.myOfficeUpdateNumber(numberData, function(data) {
updateAccount();
});
Expand All @@ -923,19 +929,18 @@ define(function(require){

if(callerIdNumber) {
if (monster.util.isNumberFeatureEnabled('e911')) {

if (monster.ui.valid(e911Form)) {
$.extend(true, numberData, {
dash_e911: monster.ui.getFormData(e911Form[0])
});
var e911Data = monster.ui.getFormData(e911Form[0]);

setCallerId();
setNumberData(e911Data);
}
else {
monster.ui.alert(self.i18n.active().myOffice.callerId.mandatoryE911Alert);
}
}
else {
setCallerId();
setNumberData();
}
} else {
delete account.caller_id.external;
Expand Down

0 comments on commit 377fa50

Please sign in to comment.