feature: specify device profile/batch during pending enrolment

This commit is contained in:
Gary Sharp
2025-06-27 14:51:03 +10:00
parent 57ae665070
commit 8b8b26116e
13 changed files with 418 additions and 156 deletions
@@ -11,9 +11,12 @@ namespace Disco.Web.Areas.API.Controllers
[HttpPost]
[ValidateAntiForgeryToken]
[DiscoAuthorize(Claims.Device.Actions.EnrolDevices)]
public virtual ActionResult ResolveSessionPending(string sessionId, bool approve, string reason)
public virtual ActionResult ResolveSessionPending(string sessionId, bool approve, int? deviceProfileId, int? deviceBatchId, string reason)
{
WindowsDeviceEnrolment.ResolvePendingEnrolment(sessionId, approve, CurrentUser.UserId, reason);
if (approve && deviceProfileId == null)
throw new Exception("You must select a device profile to approve the enrollment");
WindowsDeviceEnrolment.ResolvePendingEnrolment(sessionId, approve, CurrentUser.UserId, deviceProfileId, deviceBatchId, reason);
return new HttpStatusCodeResult(200);
}