Skip to content

Commit

Permalink
fix: validation for parent in CreateCommentDTO
Browse files Browse the repository at this point in the history
  • Loading branch information
Grafikart committed Dec 29, 2024
1 parent e40876d commit f76f2b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Domain/Comment/DTO/CreateCommentDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Domain\Application\Entity\Content;
use App\Domain\Auth\User;
use App\Domain\Comment\Entity\Comment;
use App\Validator\Exists;
use App\Validator\NotExists;
use Symfony\Component\Serializer\Annotation\Groups;
Expand All @@ -22,7 +23,7 @@ class CreateCommentDTO extends UpdateCommentDTO
public int $target;

#[Assert\Positive(groups: ['write'])]
#[Exists(class: Content::class, groups: ['write'])]
#[Exists(class: Comment::class, groups: ['write'])]
#[Groups(['write'])]
public ?int $parent = null;
}

0 comments on commit f76f2b4

Please sign in to comment.