From dbbac1ad59c2ea63fde7f598c7b1ab7288bf5e82 Mon Sep 17 00:00:00 2001 From: Glax Date: Tue, 1 Apr 2025 02:14:13 +0200 Subject: [PATCH] Fix Weebcentral --- API/Controllers/SearchController.cs | 7 ++++--- API/Schema/Manga.cs | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) 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; }