From 24f68b4a8e3929746a87f50c5a5ea0b73cf4e6ee Mon Sep 17 00:00:00 2001 From: glax Date: Tue, 17 Jun 2025 00:24:11 +0200 Subject: [PATCH] SearchController GetFromUrl StatusCode 404 instead of 400 if URL does not yield a Manga --- API/Controllers/SearchController.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/API/Controllers/SearchController.cs b/API/Controllers/SearchController.cs index ad46547..5af0ed2 100644 --- a/API/Controllers/SearchController.cs +++ b/API/Controllers/SearchController.cs @@ -78,12 +78,11 @@ public class SearchController(PgsqlContext context, ILog Log) : Controller /// Manga-Page URL /// /// Multiple connectors found for URL - /// No Manga at URL - /// No connector found for URL + /// Manga not found /// Error during Database Operation [HttpPost("Url")] [ProducesResponseType(Status200OK, "application/json")] - [ProducesResponseType(Status400BadRequest)] + [ProducesResponseType(Status404NotFound)] [ProducesResponseType(Status500InternalServerError, "text/plain")] public IActionResult GetMangaFromUrl([FromBody]string url) { @@ -91,7 +90,7 @@ public class SearchController(PgsqlContext context, ILog Log) : Controller return StatusCode(Status500InternalServerError, "Could not find Global Connector."); if(connector.GetMangaFromUrl(url) is not { } manga) - return BadRequest(); + return NotFound(); try { if(AddMangaToContext(manga) is { } add)