diff --git a/API/Controllers/SearchController.cs b/API/Controllers/SearchController.cs index 95639bd..cc30c6c 100644 --- a/API/Controllers/SearchController.cs +++ b/API/Controllers/SearchController.cs @@ -3,6 +3,7 @@ using API.Schema.Jobs; using API.Schema.MangaConnectors; using Asp.Versioning; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using static Microsoft.AspNetCore.Http.StatusCodes; namespace API.Controllers; @@ -37,7 +38,7 @@ public class SearchController(PgsqlContext context) : Controller if(add is not null) retMangas.Add(add); } - catch (Exception e) + catch (DbUpdateException e) { return StatusCode(500, e); } @@ -77,7 +78,7 @@ public class SearchController(PgsqlContext context) : Controller if(add is not null) retMangas.Add(add); } - catch (Exception e) + catch (DbUpdateException e) { return StatusCode(500, e.Message); } @@ -119,7 +120,7 @@ public class SearchController(PgsqlContext context) : Controller return Ok(add); return StatusCode(500); } - catch (Exception e) + catch (DbUpdateException e) { return StatusCode(500, e.Message); } diff --git a/API/Schema/Manga.cs b/API/Schema/Manga.cs index b467872..b99a9a1 100644 --- a/API/Schema/Manga.cs +++ b/API/Schema/Manga.cs @@ -40,7 +40,6 @@ public class Manga [Required] public uint Year { get; internal set; } [StringLength(8)] - [Required] public string? OriginalLanguage { get; internal set; } [Required] public MangaReleaseStatus ReleaseStatus { get; internal set; }