Skip to content

Commit b0917a5

Browse files
authored
Merge pull request #17385 from grokability/17383-fix-api-route-path
Fixed #17383 - re-add `/hardware/` as an object type in the file upload API
2 parents 43a237b + 0972c4e commit b0917a5

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

app/Http/Controllers/Api/UploadedFilesController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class UploadedFilesController extends Controller
3333
'assets' => Asset::class,
3434
'components' => Component::class,
3535
'consumables' => Consumable::class,
36+
'hardware' => Asset::class,
3637
'licenses' => License::class,
3738
'locations' => Location::class,
3839
'models' => AssetModel::class,
@@ -44,6 +45,7 @@ class UploadedFilesController extends Controller
4445
'assets' => 'private_uploads/assets/',
4546
'components' => 'private_uploads/components/',
4647
'consumables' => 'private_uploads/consumables/',
48+
'hardware' => 'private_uploads/assets/',
4749
'licenses' => 'private_uploads/licenses/',
4850
'locations' => 'private_uploads/locations/',
4951
'models' => 'private_uploads/assetmodels/',
@@ -55,6 +57,7 @@ class UploadedFilesController extends Controller
5557
'assets' => 'asset',
5658
'components' => 'component',
5759
'consumables' => 'consumable',
60+
'hardware' => 'asset',
5861
'licenses' => 'license',
5962
'locations' => 'location',
6063
'models' => 'model',

routes/api.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@
13141314
'index'
13151315
]
13161316
)->name('api.files.index')
1317-
->where(['object_type' => 'assets|models|users|locations|accessories|consumables|licenses|components']);
1317+
->where(['object_type' => 'assets|hardware|models|users|locations|accessories|consumables|licenses|components']);
13181318

13191319
// Get a file
13201320
Route::get('{object_type}/{id}/files/{file_id}',
@@ -1323,7 +1323,7 @@
13231323
'show'
13241324
]
13251325
)->name('api.files.show')
1326-
->where(['object_type' => 'assets|models|users|locations|accessories|consumables|licenses|components']);
1326+
->where(['object_type' => 'assets|hardware|models|users|locations|accessories|consumables|licenses|components']);
13271327

13281328
// Upload files(s)
13291329
Route::post('{object_type}/{id}/files',
@@ -1332,7 +1332,7 @@
13321332
'store'
13331333
]
13341334
)->name('api.files.store')
1335-
->where(['object_type' => 'assets|models|users|locations|accessories|consumables|licenses|components']);
1335+
->where(['object_type' => 'assets|hardware|models|users|locations|accessories|consumables|licenses|components']);
13361336

13371337
// Delete files(s)
13381338
Route::delete('{object_type}/{id}/files/{file_id}/delete',
@@ -1341,6 +1341,6 @@
13411341
'destroy'
13421342
]
13431343
)->name('api.files.destroy')
1344-
->where(['object_type' => 'assets|models|users|locations|accessories|consumables|licenses|components']);
1344+
->where(['object_type' => 'assets|hardware|models|users|locations|accessories|consumables|licenses|components']);
13451345

13461346
}); // end API routes

0 commit comments

Comments
 (0)