Skip to content
Snippets Groups Projects
Commit 0b02abfa authored by fakihap's avatar fakihap
Browse files

fix: controller fix for query search

note: need to be tested on rebuilt docker image
parent ff1b6338
Branches
Tags
No related merge requests found
......@@ -393,6 +393,14 @@ class RecipeController extends Controller implements ControllerInterface {
$searchQuery["page"] = $_GET["page"];
}
if(isset($_GET["sort_by"])) {
$searchQuery["sort_by"] = $_GET["sort_by"];
}
if(isset($_GET["sort_dir"])) {
$searchQuery["sort_dir"] = $_GET["sort_dir"];
}
$data = $recipeModel->getBySearchQuery($searchQuery);
if(isset($_GET["filter_by_tag"])) {
......@@ -403,6 +411,14 @@ class RecipeController extends Controller implements ControllerInterface {
$data["diff"] = $_GET["filter_by_diff"];
}
if(isset($_GET["sort_by"])) {
$data["sort_by"] = $_GET["sort_by"];
}
if(isset($_GET["sort_dir"])) {
$data["sort_dir"] = $_GET["sort_dir"];
}
if(isset($_GET["page"])) {
$data["curPages"] = $_GET["page"];// careful different indexing start
} else {
......
......@@ -212,6 +212,7 @@ class RecipeModel {
}
// else default DESC
}
if (isset($search_query['page_rows'])) {
$rows = $search_query['page_rows'];
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment