Skip to content

Commit

Permalink
Merge pull request #55 from devaslanphp/dev
Browse files Browse the repository at this point in the history
Bug-fix: Edit comment
  • Loading branch information
heloufir authored Sep 19, 2022
2 parents 2a2a195 + 6a05160 commit fe8718b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app/Http/Livewire/TicketDetailsCommentsContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ protected function getFormSchema(): array
/**
* Launch the update function
*
* @param Comment $comment
* @param int $comment
* @return void
*/
public function updateComment(Comment $comment): void
public function updateComment(int $comment): void
{
$this->selectedComment = $comment;
$this->selectedComment = Comment::where('id', $comment)->first();
$this->form->fill([
'content' => $comment->content
'content' => $this->selectedComment->content
]);
$this->updating = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class="py-2 px-3 rounded-lg shadow hover:shadow-lg bg-primary-700 hover:bg-prima
@endif
@if($comment->owner_id === auth()->user()->id && (!$updating || $comment->id !== $selectedComment?->id))
<div class="w-full flex flex-row justify-start items-center gap-5">
<button type="button" wire:click="updateComment({{ $comment }})"
<button type="button" wire:click="updateComment('{{ $comment->id }}')"
class="text-gray-400 text-xs hover:text-primary-500 flex flex-row justify-start items-center gap-1">
<i class="fa fa-pencil"></i> @lang('Edit')
</button>
Expand Down

0 comments on commit fe8718b

Please sign in to comment.