Skip to content

NOW MANAGED ON CODEBERG

Fixed api query total not taking filters into account

Dan Browna17b82bdde2d
diff --git a/app/Api/ListingResponseBuilder.php b/app/Api/ListingResponseBuilder.php
index 942c5d270..5245a5d90 100644
--- a/app/Api/ListingResponseBuilder.php
+++ b/app/Api/ListingResponseBuilder.php
@@ -36,6 +36,8 @@ class ListingResponseBuilder
*/
public function toResponse()
{
+ $this->applyFiltering($this->query);
+
$total = $this->query->count();
$data = $this->fetchData();
@@ -52,7 +54,6 @@ class ListingResponseBuilder
{
$this->applyCountAndOffset($this->query);
$this->applySorting($this->query);
- $this->applyFiltering($this->query);
return $this->query->get($this->fields);
}
diff --git a/app/Config/snappy.php b/app/Config/snappy.php
index 60c26ffd5..f347eda23 100644
--- a/app/Config/snappy.php
+++ b/app/Config/snappy.php
@@ -13,7 +13,9 @@ return [
'enabled' => true,
'binary' => file_exists(base_path('wkhtmltopdf')) ? base_path('wkhtmltopdf') : env('WKHTMLTOPDF', false),
'timeout' => false,
- 'options' => [],
+ 'options' => [
+ 'outline' => true
+ ],
'env' => [],
],
'image' => [