rewrote getchildusers
This commit is contained in:
parent
55628e2186
commit
c2d10b63d2
|
@ -171,8 +171,8 @@ public class Controller : ControllerBase
|
||||||
return folder;
|
return folder;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet(nameof(GetAllChildUsers))]
|
[HttpGet(nameof(GetAllDirectChildUsers))]
|
||||||
public ActionResult<IEnumerable<User>> GetAllChildUsers(Token authToken)
|
public ActionResult<IEnumerable<User>> GetAllDirectChildUsers(Token authToken)
|
||||||
{
|
{
|
||||||
var user = Db.GetSession(authToken)?.User;
|
var user = Db.GetSession(authToken)?.User;
|
||||||
if (user == null)
|
if (user == null)
|
||||||
|
@ -181,6 +181,16 @@ public class Controller : ControllerBase
|
||||||
return user.ChildUsers().ToList();
|
return user.ChildUsers().ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet(nameof(GetAllChildUsers))]
|
||||||
|
public ActionResult<IEnumerable<User>> GetAllChildUsers(Token authToken)
|
||||||
|
{
|
||||||
|
var user = Db.GetSession(authToken)?.User;
|
||||||
|
if (user == null)
|
||||||
|
return Unauthorized();
|
||||||
|
|
||||||
|
return user.DescendantUsers().ToList();
|
||||||
|
|
||||||
|
|
||||||
[HttpGet(nameof(GetAllInstallations))]
|
[HttpGet(nameof(GetAllInstallations))]
|
||||||
public ActionResult<IEnumerable<Installation>> GetAllInstallations(Token authToken)
|
public ActionResult<IEnumerable<Installation>> GetAllInstallations(Token authToken)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue