removes unnecessary function

This commit is contained in:
Godfrey M 2023-03-15 15:57:45 -07:00
parent 576b8f8c48
commit 371e142bae
2 changed files with 6 additions and 21 deletions

View file

@ -528,7 +528,7 @@ class Helper
* @since [v2.5]
* @return array
*/
public static function categoryTypeList()
public static function categoryTypeList($selection=null)
{
$category_types = [
'' => '',
@ -539,27 +539,12 @@ class Helper
'license' => trans('general.license'),
];
if($selection != null){
return $category_types[$selection];
}
else
return $category_types;
}
public static function categoryType($category_type){
switch ($category_type) {
case ('accessory'):
return trans('general.accessory');
break;
case ('consumable'):
return trans('general.consumable');
break;
case ('component'):
return trans('general.component');
break;
case ('asset'):
return trans('general.asset');
case ('license'):
return trans('general.license');
}
}
/**
* Get the list of custom fields in an array to make a dropdown menu
*

View file

@ -47,7 +47,7 @@ class CategoriesTransformer
'id' => (int) $category->id,
'name' => e($category->name),
'image' => ($category->image) ? Storage::disk('public')->url('categories/'.e($category->image)) : null,
'category_type' => Helper::categoryType($category->category_type),
'category_type' => Helper::categoryTypeList($category->category_type),
'has_eula' => ($category->getEula() ? true : false),
'use_default_eula' => ($category->use_default_eula=='1' ? true : false),
'eula' => ($category->getEula()),