mirror of
https://github.com/C9Glax/tranga.git
synced 2025-05-22 06:03:01 +02:00
GET Mangaconnector endpoint
This commit is contained in:
parent
40c70fbf19
commit
62b035f6c5
@ -24,6 +24,31 @@ public class MangaConnectorController(PgsqlContext context, ILog Log) : Controll
|
||||
return Ok(connectors);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the MangaConnector with the requested Name
|
||||
/// </summary>
|
||||
/// <param name="MangaConnectorName"></param>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="404">Connector with ID not found.</response>
|
||||
/// <response code="500">Error during Database Operation</response>
|
||||
[HttpGet("{MangaConnectorName}")]
|
||||
[ProducesResponseType<MangaConnector>(Status200OK, "application/json")]
|
||||
public IActionResult GetConnector(string MangaConnectorName)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(context.MangaConnectors.Find(MangaConnectorName) is not { } connector)
|
||||
return NotFound();
|
||||
|
||||
return Ok(connector);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(e);
|
||||
return StatusCode(500, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get all enabled Connectors (Scanlation-Sites)
|
||||
/// </summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user