|
|
@@ -478,4 +478,24 @@ class ApiController implements LoggerAwareInterface
|
|
|
|
|
|
return new JsonResponse($results);
|
|
|
}
|
|
|
+
|
|
|
+ public function deleteUserCreatedPagesAction(ServerRequest $request): JsonResponse
|
|
|
+ {
|
|
|
+ $this->assertIpAllowed();
|
|
|
+
|
|
|
+ $organizationId = $this->getOrganizationId($request);
|
|
|
+
|
|
|
+ $this->preventIfIsDubious();
|
|
|
+ $this->preventOnMissingConfirmationToken($organizationId);
|
|
|
+
|
|
|
+ $rootUid = $this->siteController->deleteUserCreatedPagesAction($organizationId);
|
|
|
+
|
|
|
+ return new JsonResponse(
|
|
|
+ [
|
|
|
+ 'organization_id' => $organizationId,
|
|
|
+ 'msg' => "The website with root uid " . $rootUid . " had its user-created pages deleted.",
|
|
|
+ 'root_uid' => $rootUid
|
|
|
+ ]
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|