fix: migrate db schema for smtp + discord
This commit is contained in:
@@ -10,26 +10,28 @@ class DiscordSettings extends Component
|
||||
{
|
||||
public Team $model;
|
||||
protected $rules = [
|
||||
'model.discord.enabled' => 'nullable|boolean',
|
||||
'model.discord.webhook_url' => 'required|url',
|
||||
'model.discord_notifications.test' => 'nullable|boolean',
|
||||
'model.discord_notifications.deployments' => 'nullable|boolean',
|
||||
'model.discord_notifications.status_changes' => 'nullable|boolean',
|
||||
'model.discord_enabled' => 'nullable|boolean',
|
||||
'model.discord_webhook_url' => 'required|url',
|
||||
'model.discord_notifications_test' => 'nullable|boolean',
|
||||
'model.discord_notifications_deployments' => 'nullable|boolean',
|
||||
'model.discord_notifications_status_changes' => 'nullable|boolean',
|
||||
];
|
||||
protected $validationAttributes = [
|
||||
'model.discord.webhook_url' => 'Discord Webhook',
|
||||
'model.discord_webhook_url' => 'Discord Webhook',
|
||||
];
|
||||
public function instantSave()
|
||||
{
|
||||
try {
|
||||
$this->submit();
|
||||
} catch (\Exception $e) {
|
||||
$this->model->discord->enabled = false;
|
||||
ray($e->getMessage());
|
||||
$this->model->discord_enabled = false;
|
||||
$this->validate();
|
||||
}
|
||||
}
|
||||
public function saveModel()
|
||||
{
|
||||
ray($this->model);
|
||||
$this->model->save();
|
||||
if (is_a($this->model, Team::class)) {
|
||||
session(['currentTeam' => $this->model]);
|
||||
@@ -47,4 +49,4 @@ class DiscordSettings extends Component
|
||||
$this->model->notify(new TestNotification('discord'));
|
||||
$this->emit('success', 'Test notification sent.');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user