From 188124991eb66603d515962fe404c1a027b4d135 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 4 Jul 2024 05:54:13 +0100 Subject: [PATCH] fix for losing data... LOL --- src/main/java/cc/fascinated/bat/model/BatGuild.java | 2 +- src/main/java/cc/fascinated/bat/model/BatUser.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/cc/fascinated/bat/model/BatGuild.java b/src/main/java/cc/fascinated/bat/model/BatGuild.java index 8b886a5..e8c8031 100644 --- a/src/main/java/cc/fascinated/bat/model/BatGuild.java +++ b/src/main/java/cc/fascinated/bat/model/BatGuild.java @@ -158,7 +158,7 @@ public class BatGuild extends ProfileHolder { document.put("_id", id); document.put("createdAt", createdAt); - Map profileDocuments = new HashMap<>(); + Map profileDocuments = this.document.get("profiles", new HashMap<>()); for (Serializable profile : getProfiles().values()) { profileDocuments.put(profile.getClass().getSimpleName(), profile.serialize(BatApplication.GSON)); } diff --git a/src/main/java/cc/fascinated/bat/model/BatUser.java b/src/main/java/cc/fascinated/bat/model/BatUser.java index 83e10a2..bb887fd 100644 --- a/src/main/java/cc/fascinated/bat/model/BatUser.java +++ b/src/main/java/cc/fascinated/bat/model/BatUser.java @@ -113,7 +113,7 @@ public class BatUser extends ProfileHolder { document.put("_id", id); document.put("createdAt", createdAt); - Map profileDocuments = new HashMap<>(); + Map profileDocuments = this.document.get("profiles", new HashMap<>()); for (Serializable profile : getProfiles().values()) { profileDocuments.put(profile.getClass().getSimpleName(), profile.serialize(BatApplication.GSON)); }