Add Request to get lists

This commit is contained in:
Philipp Lang 2022-10-20 11:34:22 +02:00
parent 4786bd3a15
commit 9b1e423210
2 changed files with 7 additions and 1 deletions

View File

@ -31,7 +31,7 @@ class SettingIndexAction
session()->put('title', 'Mailman-Einstellungen');
$state = $settings->base_url && $settings->username && $settings->password && $settings->is_active
? app(MailmanService::class)->setCredentials($settings->base_url, $settings->username, $settings->password)->check()
? app(MailmanService::class)->fromSettings($settings)->check()
: null;
return Inertia::render('setting/Mailman', [

View File

@ -4,6 +4,7 @@ namespace App\Mailman\Support;
use App\Mailman\Data\MailingList;
use App\Mailman\Exceptions\MailmanServiceException;
use App\Mailman\MailmanSettings;
use Illuminate\Http\Client\ConnectionException;
use Illuminate\Http\Client\PendingRequest;
use Illuminate\Support\Facades\Http;
@ -25,6 +26,11 @@ class MailmanService
return $this;
}
public function fromSettings(MailmanSettings $settings): self
{
return $this->setCredentials($settings->base_url, $settings->username, $settings->password);
}
public function check(): bool
{
try {