mirror of
https://github.com/cupcakearmy/coolify.git
synced 2024-10-22 16:14:22 +02:00
fix: team error
This commit is contained in:
parent
e17ff99c5b
commit
4b2ffb456f
@ -46,6 +46,7 @@ public function submit()
|
|||||||
public function saveModel()
|
public function saveModel()
|
||||||
{
|
{
|
||||||
$this->team->save();
|
$this->team->save();
|
||||||
|
refreshSession();
|
||||||
$this->emit('success', 'Settings saved.');
|
$this->emit('success', 'Settings saved.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ public function submitFromFields()
|
|||||||
'team.smtp_from_name' => 'required',
|
'team.smtp_from_name' => 'required',
|
||||||
]);
|
]);
|
||||||
$this->team->save();
|
$this->team->save();
|
||||||
|
refreshSession();
|
||||||
$this->emit('success', 'Settings saved successfully.');
|
$this->emit('success', 'Settings saved successfully.');
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
@ -81,6 +82,7 @@ public function instantSaveInstance()
|
|||||||
$this->team->smtp_enabled = false;
|
$this->team->smtp_enabled = false;
|
||||||
$this->team->resend_enabled = false;
|
$this->team->resend_enabled = false;
|
||||||
$this->team->save();
|
$this->team->save();
|
||||||
|
refreshSession();
|
||||||
$this->emit('success', 'Settings saved successfully.');
|
$this->emit('success', 'Settings saved successfully.');
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
@ -110,6 +112,7 @@ public function instantSave()
|
|||||||
public function saveModel()
|
public function saveModel()
|
||||||
{
|
{
|
||||||
$this->team->save();
|
$this->team->save();
|
||||||
|
refreshSession();
|
||||||
$this->emit('success', 'Settings saved.');
|
$this->emit('success', 'Settings saved.');
|
||||||
}
|
}
|
||||||
public function submit()
|
public function submit()
|
||||||
@ -127,6 +130,7 @@ public function submit()
|
|||||||
'team.smtp_timeout' => 'nullable',
|
'team.smtp_timeout' => 'nullable',
|
||||||
]);
|
]);
|
||||||
$this->team->save();
|
$this->team->save();
|
||||||
|
refreshSession();
|
||||||
$this->emit('success', 'Settings saved successfully.');
|
$this->emit('success', 'Settings saved successfully.');
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$this->team->smtp_enabled = false;
|
$this->team->smtp_enabled = false;
|
||||||
@ -143,6 +147,7 @@ public function submitResend()
|
|||||||
'team.resend_api_key' => 'required'
|
'team.resend_api_key' => 'required'
|
||||||
]);
|
]);
|
||||||
$this->team->save();
|
$this->team->save();
|
||||||
|
refreshSession();
|
||||||
$this->emit('success', 'Settings saved successfully.');
|
$this->emit('success', 'Settings saved successfully.');
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$this->team->resend_enabled = false;
|
$this->team->resend_enabled = false;
|
||||||
|
@ -52,6 +52,7 @@ public function submit()
|
|||||||
public function saveModel()
|
public function saveModel()
|
||||||
{
|
{
|
||||||
$this->team->save();
|
$this->team->save();
|
||||||
|
refreshSession();
|
||||||
$this->emit('success', 'Settings saved.');
|
$this->emit('success', 'Settings saved.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ public function submit()
|
|||||||
$this->validate();
|
$this->validate();
|
||||||
try {
|
try {
|
||||||
$this->team->save();
|
$this->team->save();
|
||||||
|
refreshSession();
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
}
|
}
|
||||||
|
@ -21,9 +21,9 @@ class Team extends Model implements SendsDiscord, SendsEmail
|
|||||||
|
|
||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::saved(function () {
|
// static::saved(function () {
|
||||||
refreshSession();
|
// refreshSession();
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
public function routeNotificationForDiscord()
|
public function routeNotificationForDiscord()
|
||||||
|
@ -62,7 +62,7 @@ function showBoarding(): bool
|
|||||||
function refreshSession(?Team $team = null): void
|
function refreshSession(?Team $team = null): void
|
||||||
{
|
{
|
||||||
if (!$team) {
|
if (!$team) {
|
||||||
if (auth()->user()->currentTeam()) {
|
if (auth()->user()?->currentTeam()) {
|
||||||
$team = Team::find(auth()->user()->currentTeam()->id);
|
$team = Team::find(auth()->user()->currentTeam()->id);
|
||||||
} else {
|
} else {
|
||||||
$team = User::find(auth()->user()->id)->teams->first();
|
$team = User::find(auth()->user()->id)->teams->first();
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"version": "3.12.36"
|
"version": "3.12.36"
|
||||||
},
|
},
|
||||||
"v4": {
|
"v4": {
|
||||||
"version": "4.0.0-beta.38"
|
"version": "4.0.0-beta.33"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user