A free open source IT asset/license management system
Fixed typo and spacing
snipe316f1be3d0d6
diff --git a/app/Http/Controllers/Api/AccessoriesController.php b/app/Http/Controllers/Api/AccessoriesController.phpindex 93e5047b67..400c71b672 100644--- a/app/Http/Controllers/Api/AccessoriesController.php+++ b/app/Http/Controllers/Api/AccessoriesController.php@@ -417,6 +417,7 @@ class AccessoriesController extends Controller{$this->authorize('history', $accessory);$history = $accessory->getHistory($request);+return response()->json((new ActionlogsTransformer)->transformActionlogs($history, $history->count()), 200, ['Content-Type' => 'application/json;charset=utf8'], JSON_UNESCAPED_UNICODE);}}diff --git a/app/Http/Controllers/Api/ConsumablesController.php b/app/Http/Controllers/Api/ConsumablesController.phpindex b342e1fe74..6fe6d1e004 100644--- a/app/Http/Controllers/Api/ConsumablesController.php+++ b/app/Http/Controllers/Api/ConsumablesController.php@@ -373,6 +373,7 @@ class ConsumablesController extends Controller{$this->authorize('history', $consumable);$history = $consumable->getHistory($request);+return response()->json((new ActionlogsTransformer)->transformActionlogs($history, $history->count()), 200, ['Content-Type' => 'application/json;charset=utf8'], JSON_UNESCAPED_UNICODE);}}diff --git a/app/Http/Controllers/Api/MaintenancesController.php b/app/Http/Controllers/Api/MaintenancesController.phpindex fc5cb3198b..7a132ab7e2 100644--- a/app/Http/Controllers/Api/MaintenancesController.php+++ b/app/Http/Controllers/Api/MaintenancesController.php@@ -37,7 +37,7 @@ class MaintenancesController extends Controller$this->authorize('view', Asset::class);$maintenances = Maintenance::select('maintenances.*')- ->with('asset', 'asset.model', 'asset.location', 'asset.defaultLoc', 'supplier', 'asset.company', 'asset.assetstatus', 'adminuser', 'asset.assignedTo',);+ ->with('asset', 'asset.model', 'asset.location', 'asset.defaultLoc', 'supplier', 'asset.company', 'asset.assetstatus', 'adminuser', 'asset.assignedTo');if ($request->filled('search')) {$maintenances = $maintenances->TextSearch($request->input('search'));@@ -130,7 +130,7 @@ class MaintenancesController extends Controllerif (request()->input('format') == 'flat') {return (new MaintenancesTransformer)->transformMaintenancesFlat($maintenances, $total);}-+return (new MaintenancesTransformer)->transformMaintenances($maintenances, $total);}@@ -259,6 +259,7 @@ class MaintenancesController extends Controller$asset = $maintenance->asset;$this->authorize('history', $asset);$history = $maintenance->getHistory($request);+return response()->json((new ActionlogsTransformer)->transformActionlogs($history, $history->count()), 200, ['Content-Type' => 'application/json;charset=utf8'], JSON_UNESCAPED_UNICODE);}}diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.phpindex 78111cbd15..7f47c0fab2 100644--- a/app/Providers/AuthServiceProvider.php+++ b/app/Providers/AuthServiceProvider.php@@ -148,7 +148,6 @@ class AuthServiceProvider extends ServiceProviderreturn false;});-/*** Define the demo mode gate so we have an easy way to use @can and Gate::allows()diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.phpindex 9b36581dc2..5e9dd8cf9c 100644--- a/database/factories/UserFactory.php+++ b/database/factories/UserFactory.php@@ -150,7 +150,6 @@ class UserFactory extends Factoryreturn $this->appendPermission(['consumables.view' => '1']);}-public function createAssets(){return $this->appendPermission(['assets.create' => '1']);diff --git a/resources/views/blade/table/history.blade.php b/resources/views/blade/table/history.blade.phpindex da2d5439f1..6969835c51 100644--- a/resources/views/blade/table/history.blade.php+++ b/resources/views/blade/table/history.blade.php@@ -19,7 +19,5 @@api_url="{{ $route }}"export_filename="export-history-{{ date('Y-m-d') }}"/>-@else- Nope@endcan<!-- end assets tab pane -->\ No newline at end of filediff --git a/routes/api.php b/routes/api.phpindex 34a63d03ae..840ab202e6 100644--- a/routes/api.php+++ b/routes/api.php@@ -229,7 +229,6 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'api-throttle:api']], fu])->name('api.components.history');-Route::get('selectlist',[Api\ComponentsController::class,@@ -601,7 +600,6 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'api-throttle:api']], fu/*** Asset maintenances API routes*/-Route::get('/maintenances/{maintenance}/history',[Api\MaintenancesController::class,diff --git a/tests/Feature/History/Api/HistoryTest.php b/tests/Feature/History/Api/HistoryTest.phpindex 8a8a0e59f5..3c55d31868 100644--- a/tests/Feature/History/Api/HistoryTest.php+++ b/tests/Feature/History/Api/HistoryTest.php@@ -4,10 +4,10 @@ namespace Tests\Feature\History\Api;use App\Models\Accessory;use App\Models\Asset;+use App\Models\Component;use App\Models\Consumable;use App\Models\License;use App\Models\Location;-use App\Models\Component;use App\Models\Maintenance;use App\Models\User;use Tests\TestCase;