mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 15:23:12 +08:00
Move logic to determine if a new key has a duplicated name to the APiKeyService
This commit is contained in:
@@ -108,13 +108,6 @@ class GenerateKeyCommand extends Command
|
||||
roleDefinitions: $this->roleResolver->determineRoles($input),
|
||||
);
|
||||
|
||||
if ($this->apiKeyService->existsWithName($apiKeyMeta->name)) {
|
||||
$io->warning(
|
||||
sprintf('An API key with name "%s" already exists. Try with a different ome', $apiKeyMeta->name),
|
||||
);
|
||||
return ExitCode::EXIT_WARNING;
|
||||
}
|
||||
|
||||
$apiKey = $this->apiKeyService->create($apiKeyMeta);
|
||||
$io->success(sprintf('Generated API key: "%s"', $apiKeyMeta->key));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user