mirror of
https://github.com/C9Glax/tranga.git
synced 2025-04-13 03:43:17 +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
|
||||
/// </summary>
|
||||
/// <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="404">MangaConnector with ID not found</response>
|
||||
/// <response code="406">MangaConnector with ID is disabled</response>
|
||||
/// <response code="500">Error during Database Operation</response>
|
||||
[HttpPost("{MangaConnectorName}/{SearchName}")]
|
||||
[HttpPost("{MangaConnectorName}")]
|
||||
[ProducesResponseType<Manga[]>(Status200OK, "application/json")]
|
||||
[ProducesResponseType(Status404NotFound)]
|
||||
[ProducesResponseType(Status406NotAcceptable)]
|
||||
[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);
|
||||
if (connector is null)
|
||||
@ -68,7 +68,7 @@ public class SearchController(PgsqlContext context) : Controller
|
||||
else if (connector.Enabled is false)
|
||||
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();
|
||||
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