1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-06 12:02:45 +03:00

API: Initial review pass of zip import/export endpoints

Review of #5592
This commit is contained in:
Dan Brown
2025-07-18 09:54:49 +01:00
parent 3626a2265b
commit d15eb129b0
5 changed files with 55 additions and 69 deletions

View File

@@ -68,9 +68,8 @@ class ChapterExportApiController extends ApiController
public function exportZip(int $id, ZipExportBuilder $builder)
{
$chapter = $this->queries->findVisibleByIdOrFail($id);
$chapterName= $chapter->getShortName();
$zip = $builder->buildForChapter($chapter);
return $this->download()->streamedFileDirectly($zip, $chapterName . '.zip', filesize($zip), true);
return $this->download()->streamedFileDirectly($zip, $chapter->slug . '.zip', true);
}
}
}