JobList filter fix
This commit is contained in:
@@ -19,13 +19,18 @@ public class JobService
|
||||
PropertyNameCaseInsensitive = true
|
||||
};
|
||||
|
||||
public async Task<PagedResult<QueueJob>> GetJobsAsync(int page = 1, int pageSize = 50, JobStatus? status = null, JobType? jobType = null, Guid? layerId = null)
|
||||
public async Task<PagedResult<QueueJob>> GetJobsAsync(int page = 1, int pageSize = 50, List<JobStatus>? statuses = null, JobType? jobType = null, Guid? layerId = null)
|
||||
{
|
||||
var start = (page - 1) * pageSize;
|
||||
var query = $"Jobs?start={start}&limit={pageSize}";
|
||||
|
||||
if (status.HasValue)
|
||||
query += $"&status={(int)status.Value}";
|
||||
if (statuses != null && statuses.Count > 0)
|
||||
{
|
||||
foreach (var status in statuses)
|
||||
{
|
||||
query += $"&statuses={(int)status}";
|
||||
}
|
||||
}
|
||||
|
||||
if (jobType.HasValue)
|
||||
query += $"&jobType={(int)jobType.Value}";
|
||||
|
||||
Reference in New Issue
Block a user