mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-23 03:32:32 -08:00
Removed commented code
This commit is contained in:
parent
3cfcc43efa
commit
b13e04095e
|
@ -74,7 +74,6 @@ class AssetModelsController extends Controller
|
|||
$this->authorize('create', AssetModel::class);
|
||||
$assetmodel = new AssetModel;
|
||||
$assetmodel->fill($request->all());
|
||||
//$assetmodel->fieldset_id = $request->get("custom_fieldset_id");
|
||||
|
||||
if ($assetmodel->save()) {
|
||||
return response()->json(Helper::formatStandardApiResponse('success', $assetmodel, trans('admin/assetmodels/message.create.success')));
|
||||
|
|
|
@ -69,4 +69,30 @@ class CustomFieldsetsController extends Controller
|
|||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete a custom fieldset.
|
||||
*
|
||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @since [v4.0]
|
||||
* @return Redirect
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->authorize('delete', CustomFieldset::class);
|
||||
$fieldset = CustomFieldset::findOrFail($id);
|
||||
|
||||
$modelsCount = $fieldset->models->count();
|
||||
$fieldsCount = $fieldset->fields->count();
|
||||
|
||||
if (($modelsCount > 0) || ($fieldsCount > 0) ){
|
||||
return response()->json(Helper::formatStandardApiResponse('error', null, 'Fieldset is in use.'));
|
||||
} else {
|
||||
$fieldset->delete();
|
||||
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/custom_fields/message.fieldset.delete.success')));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue