From 38b7a0adb8ba9554f2a437862430e1f9f0763a38 Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Sun, 19 Apr 2026 23:36:37 +0300 Subject: [PATCH] add count validation in bulk create nodes use case --- app/Node/UseCases/BulkCreateNodes.php | 4 ++++ 1 file changed, 4 insertions(+) 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");