mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-04-30 06:30:03 +00:00
Fixed error on webhooks for recycle bin operations
Updated the getUrl method on deletions to not require any passed params to align with usage in webhooks. Probably better to have a proper interface but would require a wider change. Fixes #3154
This commit is contained in:
parent
8d91f4369b
commit
4239d4c54d
2 changed files with 3 additions and 12 deletions
app/Entities/Models
|
@ -59,7 +59,7 @@ class Deletion extends Model implements Loggable
|
||||||
/**
|
/**
|
||||||
* Get a URL for this specific deletion.
|
* Get a URL for this specific deletion.
|
||||||
*/
|
*/
|
||||||
public function getUrl($path): string
|
public function getUrl(string $path = 'restore'): string
|
||||||
{
|
{
|
||||||
return url("/settings/recycle-bin/{$this->id}/" . ltrim($path, '/'));
|
return url("/settings/recycle-bin/{$this->id}/" . ltrim($path, '/'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,19 +46,10 @@ class PageRevision extends Model
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the url for this revision.
|
* Get the url for this revision.
|
||||||
*
|
|
||||||
* @param null|string $path
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function getUrl($path = null)
|
public function getUrl(string $path = ''): string
|
||||||
{
|
{
|
||||||
$url = $this->page->getUrl() . '/revisions/' . $this->id;
|
return $this->page->getUrl('/revisions/' . $this->id . '/' . ltrim($path, '/'));
|
||||||
if ($path) {
|
|
||||||
return $url . '/' . trim($path, '/');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $url;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue