update สิทธิ์
Some checks failed
release-dev / release-dev (push) Failing after 10s

This commit is contained in:
Adisak 2025-10-28 09:25:48 +07:00
parent 451757be65
commit 5007b6f10d

View file

@ -230,12 +230,14 @@ namespace BMA.EHR.Placement.Service.Controllers
else if (role == "NORMAL")
{
placementAppointments = placementAppointments
.Where(
x => node == 0 ? x.child1DnaId == null
: (node == 1 ? x.child1DnaId != null && x.child2DnaId == null
: (node == 2 ? x.child2DnaId != null && x.child3DnaId == null
: (node == 3 ? x.child3DnaId != null && x.child4DnaId == null : true)))
).ToList();
.Where(x =>
(node == 0 && x.child1DnaId == null && x.rootDnaId == nodeId) ||
(node == 1 && x.child1DnaId != null && x.child2DnaId == null && x.child1DnaId == nodeId) ||
(node == 2 && x.child2DnaId != null && x.child3DnaId == null && x.child2DnaId == nodeId) ||
(node == 3 && x.child3DnaId != null && x.child4DnaId == null && x.child3DnaId == nodeId) ||
(node == 4 && x.child4DnaId == nodeId)
)
.ToList();
}
return Success(placementAppointments);
}