Skip to content

Commit 844ddc2

Browse files
committed
fix pagination on results causing errors on UI
1 parent 3258553 commit 844ddc2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/Components/Core/BaseRepository.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ public function get($params = [], $with = [], $callable)
4747
// data structure to our response. Let's just put the biggest number we can imagine.
4848
if(Helpers::hasValue($params['per_page']) && ($params['per_page']==-1)) $params['per_page'] = 999999999999;
4949

50+
// if don't want any pagination
51+
if(Helpers::hasValue($params['paginate']) && ($params['paginate']=='no')) return $q->get();
52+
5053
return $q->paginate($params['per_page'] ?? 10);
5154
}
5255

@@ -76,6 +79,7 @@ public function update(int $id, array $attributes)
7679
/**
7780
* @param int $id
7881
* @return bool|null
82+
* @throws \Exception
7983
*/
8084
public function delete(int $id)
8185
{

0 commit comments

Comments
 (0)