Add Request to get lists
This commit is contained in:
parent
4786bd3a15
commit
9b1e423210
|
@ -31,7 +31,7 @@ class SettingIndexAction
|
||||||
session()->put('title', 'Mailman-Einstellungen');
|
session()->put('title', 'Mailman-Einstellungen');
|
||||||
|
|
||||||
$state = $settings->base_url && $settings->username && $settings->password && $settings->is_active
|
$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;
|
: null;
|
||||||
|
|
||||||
return Inertia::render('setting/Mailman', [
|
return Inertia::render('setting/Mailman', [
|
||||||
|
|
|
@ -4,6 +4,7 @@ namespace App\Mailman\Support;
|
||||||
|
|
||||||
use App\Mailman\Data\MailingList;
|
use App\Mailman\Data\MailingList;
|
||||||
use App\Mailman\Exceptions\MailmanServiceException;
|
use App\Mailman\Exceptions\MailmanServiceException;
|
||||||
|
use App\Mailman\MailmanSettings;
|
||||||
use Illuminate\Http\Client\ConnectionException;
|
use Illuminate\Http\Client\ConnectionException;
|
||||||
use Illuminate\Http\Client\PendingRequest;
|
use Illuminate\Http\Client\PendingRequest;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
|
@ -25,6 +26,11 @@ class MailmanService
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function fromSettings(MailmanSettings $settings): self
|
||||||
|
{
|
||||||
|
return $this->setCredentials($settings->base_url, $settings->username, $settings->password);
|
||||||
|
}
|
||||||
|
|
||||||
public function check(): bool
|
public function check(): bool
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue