Skip to content

Commit

Permalink
Remove code handled by CompanyableChildTrait
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusmoore committed Sep 12, 2024
1 parent 872b76b commit 5299b3e
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions app/Http/Controllers/Api/AssetMaintenancesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,6 @@ public function destroy($assetMaintenanceId) : JsonResponse
// Check if the asset maintenance exists
$assetMaintenance = AssetMaintenance::findOrFail($assetMaintenanceId);

if (! Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'You cannot delete a maintenance for that asset'));
}

$assetMaintenance->delete();

return response()->json(Helper::formatStandardApiResponse('success', $assetMaintenance, trans('admin/asset_maintenances/message.delete.success')));
Expand Down

0 comments on commit 5299b3e

Please sign in to comment.