Skip to content

Commit 970b519

Browse files
authored
Merge pull request #10 from CodeYourFuture/update-to-latest
Update to packages to latest versions
2 parents eb6838d + 2ef4df6 commit 970b519

5 files changed

Lines changed: 3614 additions & 252 deletions

File tree

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run format

app.js

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
*
3434
* Do not edit this code.
3535
*/
36-
var account = {
36+
const account = {
3737
number: 100402153,
3838
initialBalance: 100,
39-
paymentsUrl: '/data/payments.json',
40-
payments: []
39+
paymentsUrl: "/data/payments.json",
40+
payments: [],
4141
};
4242

4343
/**
@@ -48,15 +48,14 @@ var account = {
4848
*
4949
* You may edit this code.
5050
*/
51-
document.querySelector('#loadButton')
52-
.addEventListener('click', function () {
53-
fetch(account.paymentsUrl)
54-
.then(response => response.json())
55-
.then(payments => {
56-
account.payments = payments;
57-
render(account);
58-
});
59-
});
51+
document.querySelector("#loadButton").addEventListener("click", function () {
52+
fetch(account.paymentsUrl)
53+
.then((response) => response.json())
54+
.then((payments) => {
55+
account.payments = payments;
56+
render(account);
57+
});
58+
});
6059

6160
/**
6261
* Write a render function below that updates the DOM with the
@@ -72,11 +71,9 @@ document.querySelector('#loadButton')
7271
* @param {Object} account The account details
7372
*/
7473
function render(account) {
75-
7674
// Display the account number
77-
document.querySelector('#accountNumber')
78-
.innerText = account.number;
79-
};
75+
document.querySelector("#accountNumber").innerText = account.number;
76+
}
8077

8178
/**
8279
* Write any additional functions that you need to complete

0 commit comments

Comments
 (0)