diff --git a/index.html b/index.html index 904c585..abb09db 100644 --- a/index.html +++ b/index.html @@ -27,10 +27,10 @@ diff --git a/käyttöliittymä.js b/käyttöliittymä.js index 449da71..454075f 100644 --- a/käyttöliittymä.js +++ b/käyttöliittymä.js @@ -1,7 +1,7 @@ 'use strict'; document.getElementById('kumoa').addEventListener('click', () => { - suorita(tietokanta.kumoa()); + suorita(_tietokanta.kumoa()); }); function suorita([tietokanta, muutokset]) { diff --git a/tietokanta.js b/tietokanta.js index b734ebf..6f18ac6 100644 --- a/tietokanta.js +++ b/tietokanta.js @@ -80,7 +80,7 @@ class Tietokanta { transaktio(funktio) { const transaktio = new Transaktio(this); funktio(transaktio); - return [tietokanta, this.suorita(transaktio)]; + return [this, this.suorita(transaktio)]; } suorita(transaktio) { @@ -129,7 +129,7 @@ class Tietokanta { uusi: vanha, }); } - return [tietokanta, kumotut]; + return [this, kumotut]; } hae(taulu, id) { @@ -156,4 +156,4 @@ class Tietokanta { } } -const tietokanta = new Tietokanta; +const _tietokanta = new Tietokanta;