diff --git a/web/components/bankerPage/bankAccount.js b/web/components/bankerPage/bankAccount.js index 5151c454ebcbf1fa9e645117b066854bbf04dcdb..b1939e8810ef1b781e31539840027cd0431c3408 100644 --- a/web/components/bankerPage/bankAccount.js +++ b/web/components/bankerPage/bankAccount.js @@ -92,6 +92,7 @@ class BankAccount { this.bankAccount.Type = document.getElementById("account-type").value; this.bankAccount.Amount = 0; this.bankAccount.BankOverdraft = 0; + this.bankAccount.Operations = []; this.isNew = true; this.handleDom(); } @@ -143,6 +144,7 @@ class BankAccount { throw new Error(`Banker could not be updated (status ${response.status})`); } await this.parent.updateBankAccounts(); + this.bankAccount = await response.json(); document.getElementById(`accounts-account-edit-${this.bankAccount.ID}`).click(); } catch (e) { Messages.Show("is-warning", e.message); diff --git a/web/components/bankerPage/operations.js b/web/components/bankerPage/operations.js index 50c0c50d8182b73b69107b5e2045192bd91c37c0..e8188969cb8eb7400081b06745e131899e9e85b0 100644 --- a/web/components/bankerPage/operations.js +++ b/web/components/bankerPage/operations.js @@ -102,7 +102,8 @@ class Operation { } async displayOperations(bankAccount) { - this.bankAccount = await this.updateBankAccount(bankAccount.ID); + if (bankAccount.ID != 0) this.bankAccount = await this.updateBankAccount(bankAccount.ID); + else this.bankAccount = bankAccount; const markup = this.bankAccount.Operations.map((operation) => this.operationTemplate(operation)).join(""); document.getElementById("operations-table").innerHTML = markup; diff --git a/web/components/users/users.js b/web/components/users/users.js index 958c8e147a22c1bc0322420204985baf56342478..b294dda04fbb9a5356629da7a083a9230c7097bb 100644 --- a/web/components/users/users.js +++ b/web/components/users/users.js @@ -79,7 +79,7 @@ class Users { } cleanUser(user) { - let props = ["password", "name", "surname", "memberOf"]; + let props = ["password", "name", "surname", "memberOf", "displayName"]; for (const prop of props) { user[prop] = user[prop] === undefined ? "" : user[prop]; }