feat(*.php, *.psql): deduplicate API code + performance improvements

This commit is contained in:
Cory Dransfeldt 2025-04-22 14:00:40 -07:00
parent 92d84e7377
commit 4e2205e0f9
No known key found for this signature in database
19 changed files with 449 additions and 604 deletions

View file

@ -15,17 +15,9 @@ class ContactHandler extends BaseHandler
public function __construct(?Client $httpClient = null)
{
parent::__construct();
$this->httpClient = $httpClient ?? new Client();
$this->loadEnvironment();
}
private function loadEnvironment(): void
{
$this->postgrestUrl = $_ENV["POSTGREST_URL"] ?? getenv("POSTGREST_URL");
$this->postgrestApiKey =
$_ENV["POSTGREST_API_KEY"] ?? getenv("POSTGREST_API_KEY");
$this->forwardEmailApiKey =
$_ENV["FORWARDEMAIL_API_KEY"] ?? getenv("FORWARDEMAIL_API_KEY");
$this->forwardEmailApiKey = $_ENV["FORWARDEMAIL_API_KEY"] ?? getenv("FORWARDEMAIL_API_KEY");
}
public function handleRequest(): void