From 62bce97f00e727a11a97cd0347aa0ea24bb78f60 Mon Sep 17 00:00:00 2001 From: ecyr20 Date: Fri, 26 Apr 2024 17:06:53 -0500 Subject: [PATCH] Fixed missing comma is JSON --- Services/OpenAtmosService.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Services/OpenAtmosService.cs b/Services/OpenAtmosService.cs index 5ea0057..8f14a49 100644 --- a/Services/OpenAtmosService.cs +++ b/Services/OpenAtmosService.cs @@ -134,8 +134,10 @@ public async Task GetJSON(Guid tag_mechanism_uuid) foreach (ReactantsProducts reactant in reactants) { JSON += " \"species name\": \"" + reactant.type + "\", \n"; - JSON += " \"coefficient\": \"" + reactant.quantity + "\" \n"; + JSON += " \"coefficient\": \"" + reactant.quantity + "\", \n"; } + JSON = JSON.Remove(JSON.LastIndexOf(',')); + JSON += "\n"; JSON += " }\n" + " ], \n"; } @@ -149,8 +151,10 @@ public async Task GetJSON(Guid tag_mechanism_uuid) foreach (ReactantsProducts product in products) { JSON += " \"species name\": \"" + product.type + "\", \n"; - JSON += " \"coefficient\": \"" + product.quantity + "\" \n"; + JSON += " \"coefficient\": \"" + product.quantity + "\", \n"; } + JSON = JSON.Remove(JSON.LastIndexOf(',')); + JSON += "\n"; JSON += " }\n" + " ]\n"; }