File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
app/Transformers/Api/Application Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 22
33namespace Pterodactyl \Transformers \Api \Application ;
44
5+ use Pterodactyl \Models \Node ;
6+ use Pterodactyl \Models \Server ;
57use Pterodactyl \Models \Allocation ;
68use Pterodactyl \Services \Acl \Api \AdminAcl ;
79
@@ -54,10 +56,8 @@ public function includeNode(Allocation $allocation)
5456 return $ this ->null ();
5557 }
5658
57- $ allocation ->loadMissing ('node ' );
58-
5959 return $ this ->item (
60- $ allocation ->getRelation ( ' node ' ) , $ this ->makeTransformer (NodeTransformer::class), ' node '
60+ $ allocation ->node , $ this ->makeTransformer (NodeTransformer::class), Node:: RESOURCE_NAME
6161 );
6262 }
6363
@@ -70,14 +70,12 @@ public function includeNode(Allocation $allocation)
7070 */
7171 public function includeServer (Allocation $ allocation )
7272 {
73- if (! $ this ->authorize (AdminAcl::RESOURCE_SERVERS )) {
73+ if (! $ this ->authorize (AdminAcl::RESOURCE_SERVERS ) || ! $ allocation -> server ) {
7474 return $ this ->null ();
7575 }
7676
77- $ allocation ->loadMissing ('server ' );
78-
7977 return $ this ->item (
80- $ allocation ->getRelation ( ' server ' ) , $ this ->makeTransformer (ServerTransformer::class), ' server '
78+ $ allocation ->server , $ this ->makeTransformer (ServerTransformer::class), Server:: RESOURCE_NAME
8179 );
8280 }
8381}
You can’t perform that action at this time.
0 commit comments