mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-10-02 14:23:21 +00:00
Add locationId filter to GetWorkOrderList
- Accept locationId query parameter for server-side location filtering - Used by dispatch modal to find all WOs at the same site
This commit is contained in:
parent
575e8ab6fc
commit
3355df111f
1 changed files with 4 additions and 1 deletions
|
|
@ -369,7 +369,7 @@ namespace Api.SeaHavenIndustries.Controllers
|
||||||
// GET: api/WorkOrder/GetWorkOrderList
|
// GET: api/WorkOrder/GetWorkOrderList
|
||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
[HttpGet("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 ??= "";
|
search ??= "";
|
||||||
|
|
||||||
|
|
@ -378,6 +378,9 @@ namespace Api.SeaHavenIndustries.Controllers
|
||||||
.Include(w => w.AssignToUser)
|
.Include(w => w.AssignToUser)
|
||||||
.Where(w => w.istemplate != true);
|
.Where(w => w.istemplate != true);
|
||||||
|
|
||||||
|
if (locationId.HasValue)
|
||||||
|
query = query.Where(w => w.LocationId == locationId.Value);
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(status))
|
if (!string.IsNullOrWhiteSpace(status))
|
||||||
query = query.Where(w => w.Status == status);
|
query = query.Where(w => w.Status == status);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue