File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
packages/core/src/Entities Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -535,9 +535,13 @@ public static function getDeleteAction(): Action
535535 $ translation = $ livewire ->record ->translations ()->withTrashed ()->where ('locale ' , $ currentLang )->first ();
536536
537537 if ($ translation && $ translation ->trashed ()) {
538- $ translation ->forceDelete ();
539-
540- $ livewire ->record ->checkAndDeleteIfAllTranslationsDeleted ();
538+ $ remainingTranslations = $ livewire ->record ->translations ()->withTrashed ()->where ('locale ' , '!= ' , $ currentLang )->count ();
539+
540+ if ($ remainingTranslations === 0 ) {
541+ $ livewire ->record ->forceDelete ();
542+ } else {
543+ $ translation ->forceDelete ();
544+ }
541545
542546 Notification::make ()
543547 ->title (__ ('core::core.record_permanently_deleted ' ))
You can’t perform that action at this time.
0 commit comments