mirror of
https://github.com/C9Glax/tranga.git
synced 2025-04-15 12:53:17 +02:00
Add Endpoint to return Jobs with State and Type combined
This commit is contained in:
parent
f237d82cac
commit
be72d4ba97
@ -63,6 +63,20 @@ public class JobController(PgsqlContext context) : Controller
|
|||||||
return Ok(jobsOfType);
|
return Ok(jobsOfType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns all Jobs of requested Type and State
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="JobType">Requested Job-Type</param>
|
||||||
|
/// <param name="JobState">Requested Job-State</param>
|
||||||
|
/// <response code="200"></response>
|
||||||
|
[HttpGet("TypeAndState/{JobType}/{JobState}")]
|
||||||
|
[ProducesResponseType<Job[]>(Status200OK, "application/json")]
|
||||||
|
public IActionResult GetJobsOfType(JobType JobType, JobState JobState)
|
||||||
|
{
|
||||||
|
Job[] jobsOfType = context.Jobs.Where(job => job.JobType == JobType && job.state == JobState).ToArray();
|
||||||
|
return Ok(jobsOfType);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Return Job with ID
|
/// Return Job with ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user