Skip to content

Commit 9dc58c5

Browse files
fix(cache): return correct results from cached data (#1986)
1 parent 27ac0f6 commit 9dc58c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/PowerGridComponent.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ private function getRecordsFromCache(): mixed
140140
$tag = $prefix.($customTag ?: 'powergrid-'.$this->datasource()->getModel()->getTable().'-'.$this->tableName);
141141
$cacheKey = implode('-', $this->getCacheKeys());
142142

143+
/** @var array $results */
143144
$results = Cache::tags($tag)->remember($cacheKey, $ttl, fn () => ProcessDataSource::make($this)->get());
144145

145146
if ($this->measurePerformance) {
@@ -152,7 +153,7 @@ private function getRecordsFromCache(): mixed
152153
);
153154
}
154155

155-
return $results;
156+
return $results['results'];
156157
}
157158

158159
private function getRecordsDataSource(): Paginator|MorphToMany|\Illuminate\Contracts\Pagination\LengthAwarePaginator|LengthAwarePaginator|BaseCollection

0 commit comments

Comments
 (0)