add count validation in bulk create nodes use case
This commit is contained in:
parent
32bf96dd99
commit
38b7a0adb8
1 changed files with 4 additions and 0 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue