Remove code handled by CompanyableChildTrait

This commit is contained in:
Marcus Moore 2024-09-12 13:29:44 -07:00
parent 872b76b45f
commit 5299b3e9f0
No known key found for this signature in database

View file

@ -188,10 +188,6 @@ class AssetMaintenancesController extends Controller
// 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')));