Skip to content

Commit

Permalink
Merge pull request #253 from dbarzin/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
dbarzin authored Jan 28, 2025
2 parents 01cb197 + 141b8e3 commit 2a953d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/Http/Controllers/API/ControlController.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public function destroy(Control $control)
{
abort_if(Auth::User()->role !== 4, Response::HTTP_FORBIDDEN, '403 Forbidden');

$control->measures()->detach();
$control->delete();

return response()->json();
Expand Down
3 changes: 3 additions & 0 deletions app/Http/Controllers/ActionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,9 @@ public function delete() {
// delete links
DB::table('action_measure')->where('action_id', $action->id)->delete();

// relete links to owners
$action->owners()->detach();

// delete
$action->delete();

Expand Down

0 comments on commit 2a953d4

Please sign in to comment.