add count validation in bulk create nodes use case

This commit is contained in:
Yisroel Baum 2026-04-19 23:36:37 +03:00
parent 32bf96dd99
commit 38b7a0adb8
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -39,6 +39,10 @@ class BulkCreateNodes
throw new BadRequestException('count is required');
}
if ($request->count < 1) {
throw new BadRequestException('count must be at least 1');
}
$text = $this->textRepo->find($request->textId);
if ($text === null) {
throw new DomainException("Text with id: {$request->textId} doesnt exist");