++ fix campagna

This commit is contained in:
Francesco Picone
2026-07-25 22:58:29 +02:00
parent 9421891989
commit c505708ae2
6 changed files with 30 additions and 3 deletions

View File

@@ -14,6 +14,9 @@ class CampagnaEdit extends Component
public function mount(Campagna $campagna)
{
// Modifica campagne riservata all'amministratore.
$this->authorize('settings.manage');
$this->campagna = $campagna;
$this->descrizione = $campagna->descrizione;
$this->start_date = $campagna->start_date->format('Y-m-d');
@@ -31,6 +34,10 @@ class CampagnaEdit extends Component
public function save()
{
// Re-check on the update request: route middleware guards the initial
// load, but the action can be replayed on a persisted component.
$this->authorize('settings.manage');
$this->validate();
$this->campagna->update([