Skip to content

Commit

Permalink
Bugfix: Default TicketType does not updates wrong Model
Browse files Browse the repository at this point in the history
  • Loading branch information
Hussam Itani committed Mar 17, 2024
1 parent c6e8d89 commit 344dc53
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Filament\Resources\TicketTypeResource\Pages;

use App\Filament\Resources\TicketTypeResource;
use App\Models\TicketStatus;
use App\Models\TicketType;
use Filament\Pages\Actions;
use Filament\Resources\Pages\EditRecord;

Expand All @@ -22,7 +22,7 @@ protected function getActions(): array
protected function afterSave(): void
{
if ($this->record->is_default) {
TicketStatus::where('id', '<>', $this->record->id)
TicketType::where('id', '<>', $this->record->id)
->where('is_default', true)
->update(['is_default' => false]);
}
Expand Down

0 comments on commit 344dc53

Please sign in to comment.