Merge pull request #3949 from peaklabs-dev/fix-project-deletion

Fix: Projects can be deleted with resources
This commit is contained in:
Andras Bacsai
2024-11-07 13:43:56 +01:00
committed by GitHub
6 changed files with 21 additions and 11 deletions

View File

@@ -7,7 +7,7 @@
<h1>Project: {{ data_get($project, 'name') }}</h1>
<div class="flex items-end gap-2">
<x-forms.button type="submit">Save</x-forms.button>
<livewire:project.delete-project :disabled="$project->resource_count() > 0" :project_id="$project->id" />
<livewire:project.delete-project :disabled="!$project->isEmpty()" :project_id="$project->id" />
</div>
</div>
<div class="pt-2 pb-10">Edit project details here.</div>

View File

@@ -12,7 +12,7 @@
</x-forms.button>
</form>
</x-modal-input>
<livewire:project.delete-project :disabled="$project->resource_count() > 0" :project_id="$project->id" />
<livewire:project.delete-project :disabled="!$project->isEmpty()" :project_id="$project->id" />
</div>
<div class="text-xs truncate subtitle lg:text-sm">{{ $project->name }}.</div>
<div class="grid gap-2 lg:grid-cols-2">