Send mounts when wings fetches server information, fix issue with mount fields not being updated

This commit is contained in:
Matthew Penner 2020-05-21 15:14:09 -06:00
parent e601b35f2f
commit 65393914c3
4 changed files with 58 additions and 1 deletions

View file

@ -71,6 +71,17 @@ class ServerConfigurationStructureService
*/
protected function returnCurrentFormat(Server $server)
{
$mounts = $server->mounts;
foreach ($mounts as $mount) {
unset($mount->id);
unset($mount->uuid);
unset($mount->name);
unset($mount->description);
$mount->read_only = $mount->read_only == 1;
unset($mount->user_mountable);
unset($mount->pivot);
}
return [
'uuid' => $server->uuid,
'suspended' => (bool) $server->suspended,
@ -101,6 +112,7 @@ class ServerConfigurationStructureService
],
'mappings' => $server->getAllocationMappings(),
],
'mounts' => $mounts,
];
}