Skip to content

Commit

Permalink
Merge pull request #1489 from moonshine-software/fix-issue-1485
Browse files Browse the repository at this point in the history
fix: Paginator url
  • Loading branch information
lee-to authored Jan 20, 2025
2 parents 70692a0 + 2c8d95b commit 86a0afb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Core/src/Paginator/Paginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private function changeLinkUrls(string $path): void
$changeUrl = function (?string $link) use ($path): ?string {
$current = strtok($this->path, '?');
$new = strtok($path, '?');
$query = (string) str($path)->after('?');
$query = str($path)->contains('?') ? str($path)->after('?')->value() : '';

return $link
? trim(str_replace($current, $new, $link) . '&' . $query, '&')
Expand Down
5 changes: 4 additions & 1 deletion src/UI/src/Traits/Fields/UpdateOnPreview.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ public function updateInPopover(string $component): static
return $this->withUpdateRow($component);
}

/**
* @param ?Closure(mixed $data, mixed $value, static $field): string $url
*/
public function updateOnPreview(
?Closure $url = null,
?ResourceContract $resource = null,
Expand Down Expand Up @@ -111,7 +114,7 @@ public function updateOnPreview(
}

/**
* @param Closure(mixed $data, mixed $value, self $field): string $url
* @param Closure(mixed $data, mixed $value, FieldContract $field): string $url
*/
public function setUpdateOnPreviewUrl(Closure $url, array $events = []): static
{
Expand Down

0 comments on commit 86a0afb

Please sign in to comment.