mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
PHRAS-3598 taking account webhook active
This commit is contained in:
@@ -285,6 +285,28 @@ class DeveloperController extends Controller
|
||||
return $this->app->json(['success' => true]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param ApiApplication $application
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function activeWebhook(Request $request, ApiApplication $application)
|
||||
{
|
||||
$manager = $this->getEntityManager();
|
||||
|
||||
if ($request->request->get('action') == 'activate') {
|
||||
$application->setWebhookActive(true);
|
||||
} elseif ($request->request->get('action') == 'deactivate') {
|
||||
$application->setWebhookActive(false);
|
||||
}
|
||||
|
||||
$manager->persist($application);
|
||||
$manager->flush();
|
||||
|
||||
return $this->app->json(['success' => true]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ApiAccountRepository
|
||||
*/
|
||||
|
Reference in New Issue
Block a user