mirror of
https://github.com/C9Glax/tranga.git
synced 2025-09-10 20:08:19 +02:00
GET Workers return IDs
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
using API.APIEndpointRecords;
|
using API.APIEndpointRecords;
|
||||||
using API.Workers;
|
using API.Workers;
|
||||||
using Asp.Versioning;
|
using Asp.Versioning;
|
||||||
using log4net;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using static Microsoft.AspNetCore.Http.StatusCodes;
|
using static Microsoft.AspNetCore.Http.StatusCodes;
|
||||||
// ReSharper disable InconsistentNaming
|
// ReSharper disable InconsistentNaming
|
||||||
@@ -14,14 +13,14 @@ namespace API.Controllers;
|
|||||||
public class WorkerController() : Controller
|
public class WorkerController() : Controller
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns all <see cref="BaseWorker"/>
|
/// Returns all <see cref="BaseWorker"/>.Keys
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <response code="200"></response>
|
/// <response code="200"><see cref="BaseWorker"/> Keys/IDs</response>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType<BaseWorker[]>(Status200OK, "application/json")]
|
[ProducesResponseType<string[]>(Status200OK, "application/json")]
|
||||||
public IActionResult GetAllWorkers()
|
public IActionResult GetAllWorkers()
|
||||||
{
|
{
|
||||||
return Ok(Tranga.AllWorkers.ToArray());
|
return Ok(Tranga.AllWorkers.Select(w => w.Key).ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Reference in New Issue
Block a user