Skip to content

Commit

Permalink
[5.3] MACT-101: Fix issue where updating and demoting an account is n…
Browse files Browse the repository at this point in the history
…ot tak… (#197)

* MACT-101: Fix issue where updating and demoting an account is not taking effect

* Create function to format the data
  • Loading branch information
pcandia committed Jun 25, 2024
1 parent 17ed5ce commit 5112ae4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ define(function(require) {
resource: 'account.create',
data: {
accountId: parentAccountId,
data: formData.account
data: self.formatAccountData(formData.account)
},
success: function(data, status) {
var newAccountId = data.data.id;
Expand Down Expand Up @@ -1952,7 +1952,7 @@ define(function(require) {
resource: 'account.update',
data: {
accountId: accountData.id,
data: accountData
data: self.formatAccountData(accountData)
},
success: function(data, status) {
monster.ui.toast({
Expand Down Expand Up @@ -2244,7 +2244,7 @@ define(function(require) {
resource: 'account.update',
data: {
accountId: data.id,
data: data
data: self.formatAccountData(data)
},
success: function(_data, status) {
success && success(_data, status);
Expand All @@ -2255,6 +2255,10 @@ define(function(require) {
});
},

formatAccountData: function(data) {
return _.omit(data, ['billing_mode', 'enabled', 'superduper_admin', 'wnm_allow_additions', 'created', 'is_reseller', 'reseller_id']);
},

autoGeneratePassword: function() {
return monster.util.randomString(4, 'abcdefghjkmnpqrstuvwxyz') + monster.util.randomString(4, '0123456789');
},
Expand Down

0 comments on commit 5112ae4

Please sign in to comment.