From 1b5baf90ae960597cc5adca746bc2d13227f9085 Mon Sep 17 00:00:00 2001 From: ig Date: Tue, 21 Mar 2023 11:42:49 +0100 Subject: [PATCH] Fix bug where properties were missing in json of installations and folders (were serialized as TreeNodes) --- csharp/App/Backend/Controllers/Controller.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/csharp/App/Backend/Controllers/Controller.cs b/csharp/App/Backend/Controllers/Controller.cs index d9228f964..3cd7cf127 100644 --- a/csharp/App/Backend/Controllers/Controller.cs +++ b/csharp/App/Backend/Controllers/Controller.cs @@ -162,14 +162,19 @@ public class Controller : ControllerBase [HttpGet(nameof(GetAllFoldersAndInstallations))] - public ActionResult> GetAllFoldersAndInstallations(Token authToken) + public ActionResult> GetAllFoldersAndInstallations(Token authToken) { var user = Db.GetSession(authToken)?.User; if (user is null) return Unauthorized(); + + var foldersAndInstallations = user + .AccessibleFoldersAndInstallations() + .OfType(); // Important! JSON serializer must see Objects otherwise + // it will just serialize the members of TreeNode %&@#!!! - return new (user.AccessibleFoldersAndInstallations()); + return new (foldersAndInstallations); }