Skip to content

Commit

Permalink
Fix undeletable presentations #2
Browse files Browse the repository at this point in the history
  • Loading branch information
bluecraank committed Feb 20, 2024
1 parent fb3aa3a commit 56d7f03
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Http/Controllers/PresentationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ public function destroy(string $id)

foreach($schedules as $schedule) {
if($schedule->end_date < now()) {
$schedule->presentation_id = null;
$schedule->presentation_id = 0;
$schedule->save();
} else {
return redirect()->back()->withErrors(['message' => __('Presentation is assigned to schedules')]);
}
}

return redirect()->back()->withErrors(['message' => __('Presentation is assigned to schedules')]);
}

// Delete all files
Expand Down

0 comments on commit 56d7f03

Please sign in to comment.