comments : do not add duplicate comments
This commit is contained in:
parent
db7b6171f7
commit
d022a9094b
2 changed files with 7 additions and 0 deletions
|
|
@ -19,6 +19,12 @@ return [
|
|||
|
||||
$comments = $file->comments()->isEmpty() == true ? [] : Yaml::decode($file->comments()->value());
|
||||
|
||||
foreach ($comments as $existingComment) {
|
||||
if ($existingComment['author']['email'] === $user->email() && $existingComment['text'] === $data->text) {
|
||||
return json_encode(null);
|
||||
}
|
||||
}
|
||||
|
||||
$commentData = [
|
||||
'location' => [
|
||||
'page' => $page,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue