Skip to content

Commit

Permalink
[5.4] 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… (#198)

* 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 10, 2024
1 parent 8397207 commit 5a3d5c7
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 @@ -328,7 +328,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 @@ -1946,7 +1946,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 @@ -2238,7 +2238,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 @@ -2249,6 +2249,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 5a3d5c7

Please sign in to comment.