SearchBar presque fonctionnelle, Featured qui va fetcher dans la bd
This commit is contained in:
@@ -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) {
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user