diff --git a/GrossesMitaines/GrossesMitainesAPI/Controllers/SearchController.cs b/GrossesMitaines/GrossesMitainesAPI/Controllers/SearchController.cs index 986e958..81ac81d 100644 --- a/GrossesMitaines/GrossesMitainesAPI/Controllers/SearchController.cs +++ b/GrossesMitaines/GrossesMitainesAPI/Controllers/SearchController.cs @@ -34,8 +34,8 @@ public class SearchController : Controller { if (_searchCache is not null) return SearchCached(query, preview, deep); else return Search(query, preview, deep); - } + private List Search(string query, bool? preview, bool? deep) { List products = new(); @@ -86,8 +86,10 @@ public class SearchController : Controller { query = query.Trim(); - if (_searchCache is null) + if (_searchCache is null) { + _logger.LogError(8, "Erreur de cache."); return products; + } try { // Pour faire une liste priorisée. if (preview.HasValue && preview == true)