wip
This commit is contained in:
@@ -8,27 +8,26 @@ use Livewire\Component;
|
||||
|
||||
class Create extends Component
|
||||
{
|
||||
protected string|null $from = null;
|
||||
public string $name;
|
||||
public string|null $description = null;
|
||||
public string $value;
|
||||
public string $currentRoute;
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->currentRoute = Route::current()->uri();
|
||||
}
|
||||
public function createPrivateKey()
|
||||
{
|
||||
$this->value = trim($this->value);
|
||||
if (!str_ends_with($this->value, "\n")) {
|
||||
$this->value .= "\n";
|
||||
}
|
||||
$new_private_key = PrivateKey::create([
|
||||
$private_key = PrivateKey::create([
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'private_key' => $this->value,
|
||||
'team_id' => session('currentTeam')->id
|
||||
]);
|
||||
redirect()->route('server.new');
|
||||
if ($this->from === 'server') {
|
||||
return redirect()->route('server.new');
|
||||
}
|
||||
return redirect()->route('private-key.show', ['private_key_uuid' => $private_key->uuid]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user