1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

ZIP Imports: Added parent selector for page/chapter imports

This commit is contained in:
Dan Brown
2024-11-04 16:21:22 +00:00
parent 8f6f81948e
commit 14578c2257
6 changed files with 62 additions and 8 deletions

View File

@ -72,14 +72,22 @@ class ImportController extends Controller
]);
}
public function run(int $id)
public function run(int $id, Request $request)
{
// TODO - Test access/visibility
$import = $this->imports->findVisible($id);
$parent = null;
if ($import->getType() === 'page' || $import->getType() === 'chapter') {
$data = $this->validate($request, [
'parent' => ['required', 'string']
]);
$parent = $data['parent'];
}
// TODO - Run import
// Validate again before
// TODO - Validate again before
// TODO - Check permissions before (create for main item, create for children, create for related items [image, attachments])
// TODO - Redirect to result
// TOOD - Or redirect back with errors
}