mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Updated old exportService name in controllers
This commit is contained in:
@ -8,15 +8,15 @@ use Throwable;
|
||||
class BookExportApiController extends ApiController
|
||||
{
|
||||
protected $bookRepo;
|
||||
protected $exportService;
|
||||
protected $exportFormatter;
|
||||
|
||||
/**
|
||||
* BookExportController constructor.
|
||||
*/
|
||||
public function __construct(BookRepo $bookRepo, ExportFormatter $exportService)
|
||||
public function __construct(BookRepo $bookRepo, ExportFormatter $exportFormatter)
|
||||
{
|
||||
$this->bookRepo = $bookRepo;
|
||||
$this->exportService = $exportService;
|
||||
$this->exportFormatter = $exportFormatter;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -26,7 +26,7 @@ class BookExportApiController extends ApiController
|
||||
public function exportPdf(int $id)
|
||||
{
|
||||
$book = Book::visible()->findOrFail($id);
|
||||
$pdfContent = $this->exportService->bookToPdf($book);
|
||||
$pdfContent = $this->exportFormatter->bookToPdf($book);
|
||||
return $this->downloadResponse($pdfContent, $book->slug . '.pdf');
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ class BookExportApiController extends ApiController
|
||||
public function exportHtml(int $id)
|
||||
{
|
||||
$book = Book::visible()->findOrFail($id);
|
||||
$htmlContent = $this->exportService->bookToContainedHtml($book);
|
||||
$htmlContent = $this->exportFormatter->bookToContainedHtml($book);
|
||||
return $this->downloadResponse($htmlContent, $book->slug . '.html');
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ class BookExportApiController extends ApiController
|
||||
public function exportPlainText(int $id)
|
||||
{
|
||||
$book = Book::visible()->findOrFail($id);
|
||||
$textContent = $this->exportService->bookToPlainText($book);
|
||||
$textContent = $this->exportFormatter->bookToPlainText($book);
|
||||
return $this->downloadResponse($textContent, $book->slug . '.txt');
|
||||
}
|
||||
}
|
||||
|
@ -8,15 +8,15 @@ use Throwable;
|
||||
class ChapterExportApiController extends ApiController
|
||||
{
|
||||
protected $chapterRepo;
|
||||
protected $exportService;
|
||||
protected $exportFormatter;
|
||||
|
||||
/**
|
||||
* ChapterExportController constructor.
|
||||
*/
|
||||
public function __construct(BookRepo $chapterRepo, ExportFormatter $exportService)
|
||||
public function __construct(BookRepo $chapterRepo, ExportFormatter $exportFormatter)
|
||||
{
|
||||
$this->chapterRepo = $chapterRepo;
|
||||
$this->exportService = $exportService;
|
||||
$this->exportFormatter = $exportFormatter;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -26,7 +26,7 @@ class ChapterExportApiController extends ApiController
|
||||
public function exportPdf(int $id)
|
||||
{
|
||||
$chapter = Chapter::visible()->findOrFail($id);
|
||||
$pdfContent = $this->exportService->chapterToPdf($chapter);
|
||||
$pdfContent = $this->exportFormatter->chapterToPdf($chapter);
|
||||
return $this->downloadResponse($pdfContent, $chapter->slug . '.pdf');
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ class ChapterExportApiController extends ApiController
|
||||
public function exportHtml(int $id)
|
||||
{
|
||||
$chapter = Chapter::visible()->findOrFail($id);
|
||||
$htmlContent = $this->exportService->chapterToContainedHtml($chapter);
|
||||
$htmlContent = $this->exportFormatter->chapterToContainedHtml($chapter);
|
||||
return $this->downloadResponse($htmlContent, $chapter->slug . '.html');
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ class ChapterExportApiController extends ApiController
|
||||
public function exportPlainText(int $id)
|
||||
{
|
||||
$chapter = Chapter::visible()->findOrFail($id);
|
||||
$textContent = $this->exportService->chapterToPlainText($chapter);
|
||||
$textContent = $this->exportFormatter->chapterToPlainText($chapter);
|
||||
return $this->downloadResponse($textContent, $chapter->slug . '.txt');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user