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

@@ -65,14 +65,11 @@ class PageExportApiController extends ApiController
return $this->download()->directly($markdown, $page->slug . '.md');
}
public function exportZip(int $id, ZipExportBuilder $builder)
{
$page = $this->queries->findVisibleByIdOrFail($id);
$pageSlug = $page->slug;
$zip = $builder->buildForPage($page);
return $this->download()->streamedFileDirectly($zip, $pageSlug . '.zip', filesize($zip), true);
return $this->download()->streamedFileDirectly($zip, $page->slug . '.zip', true);
}
}
}