reply comment working

This commit is contained in:
isUnknown 2024-10-29 16:51:31 +01:00
parent 2af56989c9
commit 8ed7331b61
5 changed files with 101 additions and 14 deletions

View file

@ -5,5 +5,6 @@ Kirby::plugin('adrienpayet/pdc-comments', [
require(__DIR__ . '/routes/create.php'),
require(__DIR__ . '/routes/update.php'),
require(__DIR__ . '/routes/delete.php'),
require(__DIR__ . '/routes/reply.php'),
]
]);

View file

@ -1,7 +1,7 @@
<?php
return [
'pattern' => '(:all)create-comment.json',
'pattern' => '(:all)reply-comment.json',
'method' => 'POST',
'action' => function () {
$json = file_get_contents('php://input');
@ -17,7 +17,7 @@ return [
$newComment = [
'pageUri' => $data->pageUri,
'fileUuid' => (string) $file->uuid(),
'filePageTarget' => $data->targetPage,
'filePageIndex' => $data->filePageIndex,
'text' => $data->text,
'user' => [
'name' => (string) $user->name(),