diff --git a/app/Http/Controllers/Api/ConsumablesController.php b/app/Http/Controllers/Api/ConsumablesController.php index cf5a1dd7e0..8e7f321720 100644 --- a/app/Http/Controllers/Api/ConsumablesController.php +++ b/app/Http/Controllers/Api/ConsumablesController.php @@ -213,7 +213,7 @@ class ConsumablesController extends Controller $consumable = Consumable::with(['consumableAssignments'=> function ($query) { $query->orderBy($query->getModel()->getTable().'.created_at', 'DESC'); }, - 'consumableAssignments.admin'=> function ($query) { + 'consumableAssignments.adminuser'=> function ($query) { }, 'consumableAssignments.user'=> function ($query) { }, @@ -231,8 +231,8 @@ class ConsumablesController extends Controller 'name' => ($consumable_assignment->user) ? $consumable_assignment->user->present()->nameUrl() : 'Deleted User', 'created_at' => Helper::getFormattedDateObject($consumable_assignment->created_at, 'datetime'), 'note' => ($consumable_assignment->note) ? e($consumable_assignment->note) : null, - 'admin' => ($consumable_assignment->admin) ? $consumable_assignment->admin->present()->nameUrl() : null, // legacy, so we don't change the shape of the response - 'created_by' => ($consumable_assignment->admin) ? $consumable_assignment->admin->present()->nameUrl() : null, + 'admin' => ($consumable_assignment->adminuser) ? $consumable_assignment->adminuser->present()->nameUrl() : null, // legacy, so we don't change the shape of the response + 'created_by' => ($consumable_assignment->adminuser) ? $consumable_assignment->adminuser->present()->nameUrl() : null, ]; } diff --git a/database/seeders/AssetSeeder.php b/database/seeders/AssetSeeder.php index 7bae869865..c9e61d890e 100644 --- a/database/seeders/AssetSeeder.php +++ b/database/seeders/AssetSeeder.php @@ -25,7 +25,7 @@ class AssetSeeder extends Seeder $this->ensureLocationsSeeded(); $this->ensureSuppliersSeeded(); - $this->admin = User::where('permissions->superuser', '1')->first() ?? User::factory()->firstAdmin()->create(); + $this->adminuser = User::where('permissions->superuser', '1')->first() ?? User::factory()->firstAdmin()->create(); $this->locationIds = Location::all()->pluck('id'); $this->supplierIds = Supplier::all()->pluck('id');