Skip to content

Commit

Permalink
add showUnknownForm to new survey paginate
Browse files Browse the repository at this point in the history
  • Loading branch information
Mh-Asmi committed Oct 8, 2024
1 parent a440fd3 commit eea8a8e
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,18 @@ public function paginate(
$query->with($with);
}
$query->distinct();

$results = $query->paginate($paging->getLimit() ? $paging->getLimit() : config('paging.default_laravel_pageing_limit'));

return $query->paginate($paging->getLimit());
if ($search_fields->showUnknownForm) {
$results->push((new Survey)->fill([
'id' => 0,
'name' => 'Unknown Form',
'base_language' => 'en',
]));
}

return $results;
}

private function addSurveyTableNamePrefix($fields)
Expand Down

0 comments on commit eea8a8e

Please sign in to comment.