rename query to model in actions, fixing problems with binding
This commit is contained in:
@@ -10,21 +10,21 @@ namespace LeafWeb.WebCms.Controllers
|
||||
public class ResultsController : BaseController
|
||||
{
|
||||
[MemberAuthorize(AllowGroup = "Authenticated")]
|
||||
public ActionResult Index(LeafDataQuery query)
|
||||
public ActionResult Index(LeafDataQuery model)
|
||||
{
|
||||
if (!query.HasParameters && !TempData.ContainsKey("Posted"))
|
||||
query.usr = true;
|
||||
if (!model.HasParameters && !TempData.ContainsKey("Posted"))
|
||||
model.usr = true;
|
||||
|
||||
var resultItems =
|
||||
DataService.GetLeafInputsOrdered();
|
||||
|
||||
resultItems =
|
||||
QueryFilter.Search(resultItems, query, Members.GetCurrentLoginStatus()?.Email);
|
||||
QueryFilter.Search(resultItems, model, Members.GetCurrentLoginStatus()?.Email);
|
||||
|
||||
var searchViewModel = new SearchViewModel
|
||||
{
|
||||
Items = resultItems,
|
||||
Q = query
|
||||
Q = model
|
||||
};
|
||||
|
||||
return View(searchViewModel);
|
||||
@@ -32,7 +32,7 @@ namespace LeafWeb.WebCms.Controllers
|
||||
|
||||
[MemberAuthorize(AllowGroup = "Authenticated")]
|
||||
[HttpPost]
|
||||
public ActionResult Search(LeafDataQuery query)
|
||||
public ActionResult Search(LeafDataQuery model)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
@@ -41,7 +41,7 @@ namespace LeafWeb.WebCms.Controllers
|
||||
|
||||
TempData["Posted"] = true;
|
||||
|
||||
return RedirectToCurrentUmbracoPage(query.GetNameValueCollection());
|
||||
return RedirectToCurrentUmbracoPage(model.GetNameValueCollection());
|
||||
}
|
||||
|
||||
[MemberAuthorize(AllowGroup = "Authenticated")]
|
||||
|
||||
Reference in New Issue
Block a user