From 33a451a43f470f6f5027ab10c1da56333a5388be Mon Sep 17 00:00:00 2001 From: MarcEricMartel <74071476+MarcEricMartel@users.noreply.github.com> Date: Tue, 18 Oct 2022 09:39:04 -0700 Subject: [PATCH] lolfreud --- .../GrossesMitainesAPI/Controllers/SearchController.cs | 5 ++--- GrossesMitaines/grosses-mitaines-ui/package.json | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/GrossesMitaines/GrossesMitainesAPI/Controllers/SearchController.cs b/GrossesMitaines/GrossesMitainesAPI/Controllers/SearchController.cs index 8f14534..1acf0a8 100644 --- a/GrossesMitaines/GrossesMitainesAPI/Controllers/SearchController.cs +++ b/GrossesMitaines/GrossesMitainesAPI/Controllers/SearchController.cs @@ -19,13 +19,14 @@ public class SearchController : Controller { [HttpPost(Name = "Search")] public IEnumerable Post(string query, bool? preview) { + const int PREVIEW = 3; HashSet products = new(); query = query.Trim(); try { // Pour faire une liste priorisée. if (preview.HasValue && preview == true) - products = _context.Products.Where(x => x.Title.Contains(query)).Take(3).ToHashSet(); + products = _context.Products.Where(x => x.Title.Contains(query)).Take(PREVIEW).ToHashSet(); else { products.Concat(_context.Products.Where(x => x.Title.Contains(query)).ToHashSet()); products.Concat(_context.Products.Where(x => x.Category.Contains(query)).ToHashSet()); @@ -36,7 +37,5 @@ public class SearchController : Controller { } return products; } - - } diff --git a/GrossesMitaines/grosses-mitaines-ui/package.json b/GrossesMitaines/grosses-mitaines-ui/package.json index 7e28d27..f15364d 100644 --- a/GrossesMitaines/grosses-mitaines-ui/package.json +++ b/GrossesMitaines/grosses-mitaines-ui/package.json @@ -24,7 +24,8 @@ "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", - "eject": "react-scripts eject" + "eject": "react-scripts eject", + "startsrv": "cd ../GrossesMitainesAPI/ & dotnet run" }, "eslintConfig": { "extends": [