From: Damyan Ivanov Date: Sat, 21 Aug 2021 20:15:52 +0000 (+0300) Subject: fix JSON export of templates X-Git-Tag: v0.20.0~8 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=bf595d8bb8b7b7d8d3363a26f2a9d1ddd5d7094d;p=mobile-ledger.git fix JSON export of templates --- 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(); }