Skip to content

Commit 5565eda

Browse files
committed
fix: Install app before enabling it
1 parent a6f04f3 commit 5565eda

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

apps/provisioning_api/lib/Controller/AppsController.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99
namespace OCA\Provisioning_API\Controller;
1010

11+
use OC\Installer;
1112
use OC_App;
1213
use OCP\App\AppPathNotFoundException;
1314
use OCP\App\IAppManager;
@@ -17,6 +18,7 @@
1718
use OCP\AppFramework\OCS\OCSException;
1819
use OCP\AppFramework\OCSController;
1920
use OCP\IRequest;
21+
use OCP\Server;
2022

2123
class AppsController extends OCSController {
2224
public function __construct(
@@ -108,6 +110,8 @@ public function getAppInfo(string $app): DataResponse {
108110
public function enable(string $app): DataResponse {
109111
try {
110112
$app = $this->verifyAppId($app);
113+
$installer = Server::get(Installer::class);
114+
$installer->installApp($app);
111115
$this->appManager->enableApp($app);
112116
} catch (\InvalidArgumentException $e) {
113117
throw new OCSException($e->getMessage(), OCSController::RESPOND_UNAUTHORISED);

0 commit comments

Comments
 (0)