SearchBar presque fonctionnelle, Featured qui va fetcher dans la bd

This commit is contained in:
MarcEricMartel
2022-10-26 11:29:57 -07:00
parent e40807b6a2
commit 04c7d68a44
5 changed files with 29 additions and 34 deletions

View File

@@ -62,6 +62,9 @@ public class InventoryController : Controller {
case "isDiscontinued":
ret = ret.Where(x => x.Status == Product.States.Discontinued);
break;
case "isPromoted":
ret = ret.Where(x => x.Status == Product.States.Clearance || x.Status == Product.States.Promotion);
break;
default: break;
}
switch (order) {

View File

@@ -26,8 +26,8 @@ public class SearchController : Controller {
_searchCache = _cache.GetCacheCopy();
}
[EnableCors("_myAllowSpecificOrigins"), HttpPost(Name = "Search")]
public IEnumerable<Product> Post(string query, bool? preview, bool? deep) {
[EnableCors("_myAllowSpecificOrigins"), HttpGet(Name = "Search")]
public IEnumerable<Product> Get(string query, bool? preview, bool? deep) {
if (_searchCache is not null)
return SearchCached(query, preview, deep);
else return Search(query, preview, deep);