This commit is contained in:
Andras Bacsai
2024-09-23 19:51:31 +02:00
parent 68efd4b553
commit b570ccd7d3
46 changed files with 236 additions and 211 deletions

View File

@@ -8,9 +8,13 @@ use Livewire\Component;
class Create extends Component
{
public string $name = '';
public string $value = '';
public ?string $from = null;
public ?string $description = null;
public ?string $publicKey = null;
protected $rules = [
@@ -49,7 +53,7 @@ class Create extends Component
$privateKey = PrivateKey::createAndStore([
'name' => $this->name,
'description' => $this->description,
'private_key' => trim($this->value) . "\n",
'private_key' => trim($this->value)."\n",
'team_id' => currentTeam()->id,
]);
@@ -72,7 +76,7 @@ class Create extends Component
$validationResult = PrivateKey::validateAndExtractPublicKey($this->value);
$this->publicKey = $validationResult['publicKey'];
if (!$validationResult['isValid']) {
if (! $validationResult['isValid']) {
$this->addError('value', 'Invalid private key');
}
}