diff --git a/Api.SeaHavenIndustries/Controllers/WorkOrderController.cs b/Api.SeaHavenIndustries/Controllers/WorkOrderController.cs index 4d312c4..2a4c562 100644 --- a/Api.SeaHavenIndustries/Controllers/WorkOrderController.cs +++ b/Api.SeaHavenIndustries/Controllers/WorkOrderController.cs @@ -369,7 +369,7 @@ namespace Api.SeaHavenIndustries.Controllers // GET: api/WorkOrder/GetWorkOrderList // ----------------------------------- [HttpGet("GetWorkOrderList")] - public IActionResult GetWorkOrderList(string? search = "", int page = 1, int pageSize = 12, string? sortBy = "lastUpdated", string? sortDir = "desc", string? status = "", string? assignee = "") + public IActionResult GetWorkOrderList(string? search = "", int page = 1, int pageSize = 12, string? sortBy = "lastUpdated", string? sortDir = "desc", string? status = "", string? assignee = "", int? locationId = null) { search ??= ""; @@ -378,6 +378,9 @@ namespace Api.SeaHavenIndustries.Controllers .Include(w => w.AssignToUser) .Where(w => w.istemplate != true); + if (locationId.HasValue) + query = query.Where(w => w.LocationId == locationId.Value); + if (!string.IsNullOrWhiteSpace(status)) query = query.Where(w => w.Status == status);