Fixed 1001 query on license

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2024-09-19 16:04:54 +01:00
parent 7650628d30
commit 634a4afa75
2 changed files with 2 additions and 2 deletions
@@ -182,7 +182,7 @@ class LicensesController extends Controller
public function show($id) : JsonResponse | array
{
$this->authorize('view', License::class);
$license = License::withCount('freeSeats')->findOrFail($id);
$license = License::withCount('freeSeats as free_seats_count')->findOrFail($id);
$license = $license->load('assignedusers', 'licenseSeats.user', 'licenseSeats.asset');
return (new LicensesTransformer)->transformLicense($license);