From bf595d8bb8b7b7d8d3363a26f2a9d1ddd5d7094d Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sat, 21 Aug 2021 23:15:52 +0300 Subject: [PATCH] fix JSON export of templates --- .../java/net/ktnx/mobileledger/async/ConfigWriter.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/net/ktnx/mobileledger/async/ConfigWriter.java b/app/src/main/java/net/ktnx/mobileledger/async/ConfigWriter.java index 3db7ecd6..f72a2913 100644 --- a/app/src/main/java/net/ktnx/mobileledger/async/ConfigWriter.java +++ b/app/src/main/java/net/ktnx/mobileledger/async/ConfigWriter.java @@ -105,6 +105,8 @@ public class ConfigWriter extends ConfigIO { w.name("templates") .beginArray(); for (TemplateWithAccounts t : templates) { + w.beginObject(); + w.name(Keys.UUID) .value(t.header.getUuid()); w.name(Keys.NAME) @@ -128,6 +130,8 @@ public class ConfigWriter extends ConfigIO { w.name(Keys.ACCOUNTS) .beginArray(); for (TemplateAccount a : t.accounts) { + w.beginObject(); + writeKey(w, Keys.NAME, a.getAccountName()); writeKey(w, Keys.NAME_GROUP, a.getAccountNameMatchGroup()); writeKey(w, Keys.COMMENT, a.getAccountComment()); @@ -137,9 +141,13 @@ public class ConfigWriter extends ConfigIO { writeKey(w, Keys.NEGATE_AMOUNT, a.getNegateAmount()); writeKey(w, Keys.CURRENCY, a.getCurrency()); writeKey(w, Keys.CURRENCY_GROUP, a.getCurrencyMatchGroup()); + + w.endObject(); } w.endArray(); } + + w.endObject(); } w.endArray(); } -- 2.39.5