Fix provisioning API call
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
591e75df5c
commit
3abe86dade
|
@ -26,7 +26,9 @@
|
||||||
namespace OCA\Provisioning_API\Controller;
|
namespace OCA\Provisioning_API\Controller;
|
||||||
|
|
||||||
use \OC_App;
|
use \OC_App;
|
||||||
|
use OCP\App\AppPathNotFoundException;
|
||||||
use OCP\App\IAppManager;
|
use OCP\App\IAppManager;
|
||||||
|
use OCP\AppFramework\Http;
|
||||||
use OCP\AppFramework\Http\DataResponse;
|
use OCP\AppFramework\Http\DataResponse;
|
||||||
use OCP\AppFramework\OCS\OCSException;
|
use OCP\AppFramework\OCS\OCSException;
|
||||||
use OCP\AppFramework\OCSController;
|
use OCP\AppFramework\OCSController;
|
||||||
|
@ -99,9 +101,14 @@ class AppsController extends OCSController {
|
||||||
* @PasswordConfirmationRequired
|
* @PasswordConfirmationRequired
|
||||||
* @param string $app
|
* @param string $app
|
||||||
* @return DataResponse
|
* @return DataResponse
|
||||||
|
* @throws OCSException
|
||||||
*/
|
*/
|
||||||
public function enable($app) {
|
public function enable($app) {
|
||||||
$this->appManager->enableApp($app);
|
try {
|
||||||
|
$this->appManager->enableApp($app);
|
||||||
|
} catch (AppPathNotFoundException $e) {
|
||||||
|
throw new OCSException('The request app was not found', \OCP\API::RESPOND_NOT_FOUND);
|
||||||
|
}
|
||||||
return new DataResponse();
|
return new DataResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue