Files
piratepoet/mailpoet/lib/Automation/Engine/Endpoints/System/DatabasePostEndpoint.php
2022-09-12 14:40:36 -05:00

26 lines
606 B
PHP

<?php declare(strict_types = 1);
namespace MailPoet\Automation\Engine\Endpoints\System;
use MailPoet\API\REST\Request;
use MailPoet\API\REST\Response;
use MailPoet\Automation\Engine\API\Endpoint;
use MailPoet\Automation\Engine\Migrations\Migrator;
class DatabasePostEndpoint extends Endpoint {
/** @var Migrator */
private $migrator;
public function __construct(
Migrator $migrator
) {
$this->migrator = $migrator;
}
public function handle(Request $request): Response {
$this->migrator->deleteSchema();
$this->migrator->createSchema();
return new Response(null);
}
}