PHRAS-3598 taking account webhook active

This commit is contained in:
aynsix
2021-12-06 18:00:27 +03:00
parent a48d4aab9f
commit a14e15972b
23 changed files with 261 additions and 148 deletions

View File

@@ -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
*/