diff --git a/app/Node/UseCases/BulkCreateNodes.php b/app/Node/UseCases/BulkCreateNodes.php index 966e704..f2c39ad 100644 --- a/app/Node/UseCases/BulkCreateNodes.php +++ b/app/Node/UseCases/BulkCreateNodes.php @@ -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");