mirror of
https://github.com/C9Glax/tranga.git
synced 2025-04-14 04:13:18 +02:00
Move name on Endpoint Search by controller body
This commit is contained in:
parent
0df3381c8c
commit
6449132dbf
@ -50,17 +50,17 @@ public class SearchController(PgsqlContext context) : Controller
|
|||||||
/// Initiate a search for a Manga on a specific Connector
|
/// Initiate a search for a Manga on a specific Connector
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="MangaConnectorName">Manga-Connector-ID</param>
|
/// <param name="MangaConnectorName">Manga-Connector-ID</param>
|
||||||
/// <param name="SearchName">Name/Title of the Manga</param>
|
/// <param name="name">Name/Title of the Manga</param>
|
||||||
/// <response code="200"></response>
|
/// <response code="200"></response>
|
||||||
/// <response code="404">MangaConnector with ID not found</response>
|
/// <response code="404">MangaConnector with ID not found</response>
|
||||||
/// <response code="406">MangaConnector with ID is disabled</response>
|
/// <response code="406">MangaConnector with ID is disabled</response>
|
||||||
/// <response code="500">Error during Database Operation</response>
|
/// <response code="500">Error during Database Operation</response>
|
||||||
[HttpPost("{MangaConnectorName}/{SearchName}")]
|
[HttpPost("{MangaConnectorName}")]
|
||||||
[ProducesResponseType<Manga[]>(Status200OK, "application/json")]
|
[ProducesResponseType<Manga[]>(Status200OK, "application/json")]
|
||||||
[ProducesResponseType(Status404NotFound)]
|
[ProducesResponseType(Status404NotFound)]
|
||||||
[ProducesResponseType(Status406NotAcceptable)]
|
[ProducesResponseType(Status406NotAcceptable)]
|
||||||
[ProducesResponseType<string>(Status500InternalServerError, "text/plain")]
|
[ProducesResponseType<string>(Status500InternalServerError, "text/plain")]
|
||||||
public IActionResult SearchManga(string MangaConnectorName, string SearchName)
|
public IActionResult SearchManga(string MangaConnectorName, [FromBody]string name)
|
||||||
{
|
{
|
||||||
MangaConnector? connector = context.MangaConnectors.Find(MangaConnectorName);
|
MangaConnector? connector = context.MangaConnectors.Find(MangaConnectorName);
|
||||||
if (connector is null)
|
if (connector is null)
|
||||||
@ -68,7 +68,7 @@ public class SearchController(PgsqlContext context) : Controller
|
|||||||
else if (connector.Enabled is false)
|
else if (connector.Enabled is false)
|
||||||
return StatusCode(406);
|
return StatusCode(406);
|
||||||
|
|
||||||
(Manga, List<Author>?, List<MangaTag>?, List<Link>?, List<MangaAltTitle>?)[] mangas = connector.GetManga(SearchName);
|
(Manga, List<Author>?, List<MangaTag>?, List<Link>?, List<MangaAltTitle>?)[] mangas = connector.GetManga(name);
|
||||||
List<Manga> retMangas = new();
|
List<Manga> retMangas = new();
|
||||||
foreach ((Manga? manga, List<Author>? authors, List<MangaTag>? tags, List<Link>? links, List<MangaAltTitle>? altTitles) in mangas)
|
foreach ((Manga? manga, List<Author>? authors, List<MangaTag>? tags, List<Link>? links, List<MangaAltTitle>? altTitles) in mangas)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user