3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-08-18 03:06:23 +00:00

Redirect if nothing valid to modify/delete

This commit is contained in:
snipe
2026-07-20 13:04:18 +01:00
parent bac58f034a
commit 90727db357
3 changed files with 17 additions and 2 deletions

View File

@ -344,6 +344,11 @@ class AssetModelsController extends Controller
}
}
if ($valid_count === 0) {
return redirect()->route('models.index')
->with('error', trans('admin/models/message.bulkdelete.nothing_deletable'));
}
return view('models/bulk-delete', compact('models'))->with('valid_count', $valid_count);
// Otherwise display the bulk edit screen

View File

@ -38,6 +38,11 @@ class BulkAssetModelsController extends Controller
}
}
if ($valid_count === 0) {
return redirect()->route('models.index')
->with('error', trans('admin/models/message.bulkdelete.nothing_deletable'));
}
return view('models/bulk-delete', compact('models'))->with('valid_count', $valid_count);
// Otherwise display the bulk edit screen

View File

@ -423,11 +423,16 @@ class LocationsController extends Controller
}
}
if ($valid_count === 0) {
return redirect()->route('locations.index')
->with('error', trans('general.bulk.delete.nothing_deletable', ['object_type' => trans_choice('general.location_plural', 2)]));
}
return view('locations/bulk-delete', compact('locations'))->with('valid_count', $valid_count);
}
return redirect()->route('models.index')
->with('error', 'You must select at least one model to edit.');
return redirect()->route('locations.index')
->with('error', trans('general.bulk.delete.nothing_selected', ['object_type' => trans_choice('general.location_plural', 2)]));
}
/**