Fix bug where properties were missing in json of installations and folders (were serialized as TreeNodes)
This commit is contained in:
parent
e25de16f65
commit
1b5baf90ae
|
@ -162,14 +162,19 @@ public class Controller : ControllerBase
|
||||||
|
|
||||||
|
|
||||||
[HttpGet(nameof(GetAllFoldersAndInstallations))]
|
[HttpGet(nameof(GetAllFoldersAndInstallations))]
|
||||||
public ActionResult<IEnumerable<TreeNode>> GetAllFoldersAndInstallations(Token authToken)
|
public ActionResult<IEnumerable<Object>> GetAllFoldersAndInstallations(Token authToken)
|
||||||
{
|
{
|
||||||
var user = Db.GetSession(authToken)?.User;
|
var user = Db.GetSession(authToken)?.User;
|
||||||
|
|
||||||
if (user is null)
|
if (user is null)
|
||||||
return Unauthorized();
|
return Unauthorized();
|
||||||
|
|
||||||
|
var foldersAndInstallations = user
|
||||||
|
.AccessibleFoldersAndInstallations()
|
||||||
|
.OfType<Object>(); // Important! JSON serializer must see Objects otherwise
|
||||||
|
// it will just serialize the members of TreeNode %&@#!!!
|
||||||
|
|
||||||
return new (user.AccessibleFoldersAndInstallations());
|
return new (foldersAndInstallations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue