[PLUGINS][Repeat] Repeat now added has a reply and conversation of original note

This commit is contained in:
2021-12-26 18:40:54 +00:00
committed by Diogo Peralta Cordeiro
parent e10a38a3e2
commit 78cc9c4659
2 changed files with 14 additions and 10 deletions

View File

@@ -50,12 +50,12 @@ class Repeat extends Controller
* @throws RedirectException
* @throws ServerException
*/
public function repeatAddNote(Request $request, int $id): bool|array
public function repeatAddNote(Request $request, int $note_id): bool|array
{
$user = Common::ensureLoggedIn();
$actor_id = $user->getId();
$note = Note::getByPK(['id' => $id]);
$note = Note::getByPK(['id' => $note_id]);
$form_add_to_repeat = Form::create([
['add_repeat', SubmitType::class,
@@ -103,7 +103,7 @@ class Repeat extends Controller
* @throws RedirectException
* @throws ServerException
*/
public function repeatRemoveNote(Request $request, int $id): array
public function repeatRemoveNote(Request $request, int $note_id): array
{
$user = Common::ensureLoggedIn();
@@ -122,7 +122,7 @@ class Repeat extends Controller
$form_remove_repeat->handleRequest($request);
if ($form_remove_repeat->isSubmitted()) {
if (!\is_null(\Plugin\RepeatNote\RepeatNote::unrepeatNote(note_id: $id, actor_id: $actor_id))) {
if (!\is_null(\Plugin\RepeatNote\RepeatNote::unrepeatNote(note_id: $note_id, actor_id: $actor_id))) {
DB::flush();
} else {
throw new ClientException(_m('Note wasn\'t repeated!'));
@@ -146,7 +146,7 @@ class Repeat extends Controller
return [
'_template' => 'repeat/remove_from_repeats.html.twig',
'note' => Note::getById($id),
'note' => Note::getById($note_id),
'remove_repeat' => $form_remove_repeat->createView(),
];
}