From 01fc1f675f504212c2a74e080c298ea8003dfcce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Fri, 17 May 2024 14:44:34 +0300 Subject: [PATCH] =?UTF-8?q?P=C3=A4ivit=C3=A4=20tietokanta=20toimintoa=20ku?= =?UTF-8?q?motessa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tietokanta.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tietokanta.js b/tietokanta.js index ab22f73..c33f574 100644 --- a/tietokanta.js +++ b/tietokanta.js @@ -117,6 +117,11 @@ class Tietokanta { this.seuraavaId -= idMuutos; const kumotut = []; for (const {taulu, id, vanha, uusi} of muutokset) { + if (vanha !== undefined) { + this.taulut.get(taulu).set(id, vanha); + } else { + this.taulut.get(taulu).delete(id); + } kumotut.push({ taulu, id,