fix: boarding

fix: error handling
fix: restarting state
This commit is contained in:
Andras Bacsai
2023-09-15 15:34:25 +02:00
parent fcf7c5ddd5
commit da4c2ee60f
71 changed files with 326 additions and 290 deletions

View File

@@ -32,7 +32,7 @@ class Create extends Component
refreshSession();
return redirect()->route('team.index');
} catch (\Throwable $e) {
return general_error_handler($e, $this);
return handleError($e, $this);
}
}
}

View File

@@ -28,7 +28,7 @@ class Form extends Component
try {
$this->team->save();
} catch (\Throwable $e) {
return general_error_handler($e, $this);
return handleError($e, $this);
}
}
}

View File

@@ -36,7 +36,7 @@ class InviteLink extends Component
try {
$member_emails = currentTeam()->members()->get()->pluck('email');
if ($member_emails->contains($this->email)) {
return general_error_handler(that: $this, customErrorMessage: "$this->email is already a member of " . currentTeam()->name . ".");
return handleError(livewire: $this, customErrorMessage: "$this->email is already a member of " . currentTeam()->name . ".");
}
$uuid = new Cuid2(32);
$link = url('/') . config('constants.invitation.link.base_url') . $uuid;
@@ -57,7 +57,7 @@ class InviteLink extends Component
if (!is_null($invitation)) {
$invitationValid = $invitation->isValid();
if ($invitationValid) {
return general_error_handler(that: $this, customErrorMessage: "Pending invitation already exists for $this->email.");
return handleError(livewire: $this, customErrorMessage: "Pending invitation already exists for $this->email.");
} else {
$invitation->delete();
}
@@ -91,7 +91,7 @@ class InviteLink extends Component
if ($e->getCode() === '23505') {
$error_message = 'Invitation already sent.';
}
return general_error_handler(err: $e, that: $this, customErrorMessage: $error_message);
return handleError(error: $e, livewire: $this, customErrorMessage: $error_message);
}
}
}

View File

@@ -68,7 +68,7 @@ class Create extends Component
$this->storage->save();
return redirect()->route('team.storages.show', $this->storage->uuid);
} catch (\Throwable $e) {
return general_error_handler($e, $this);
return handleError($e, $this);
}
}
@@ -78,7 +78,7 @@ class Create extends Component
$this->storage->testConnection();
return $this->emit('success', 'Connection is working. Tested with "ListObjectsV2" action.');
} catch (\Throwable $e) {
return general_error_handler($e, $this);
return handleError($e, $this);
}
}
}

View File

@@ -33,7 +33,7 @@ class Form extends Component
$this->storage->testConnection();
return $this->emit('success', 'Connection is working. Tested with "ListObjectsV2" action.');
} catch (\Throwable $e) {
return general_error_handler($e, $this);
return handleError($e, $this);
}
}
@@ -43,7 +43,7 @@ class Form extends Component
$this->storage->delete();
return redirect()->route('team.storages.all');
} catch (\Throwable $e) {
return general_error_handler($e, $this);
return handleError($e, $this);
}
}
@@ -56,7 +56,7 @@ class Form extends Component
$this->storage->save();
$this->emit('success', 'Storage settings saved.');
} catch (\Throwable $e) {
return general_error_handler($e, $this);
return handleError($e, $this);
}
}
}