Make sure the cloud_federation_api routes are loaded

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-04-17 11:19:49 +02:00 committed by Roeland Jago Douma
parent 031b6656d1
commit 6332d7c0b3
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 2 additions and 0 deletions

View File

@ -29,6 +29,8 @@ $server = \OC::$server;
$isEnabled = $server->getAppManager()->isEnabledForUser('cloud_federation_api'); $isEnabled = $server->getAppManager()->isEnabledForUser('cloud_federation_api');
if ($isEnabled) { if ($isEnabled) {
// Make sure the routes are loaded
\OC_App::loadApp('cloud_federation_api');
$capabilities = new OCA\CloudFederationAPI\Capabilities($server->getURLGenerator()); $capabilities = new OCA\CloudFederationAPI\Capabilities($server->getURLGenerator());
header('Content-Type: application/json'); header('Content-Type: application/json');
echo json_encode($capabilities->getCapabilities()['ocm']); echo json_encode($capabilities->getCapabilities()['ocm']);