Added logic to persist device long URLs while creating/editing a short URL

This commit is contained in:
Alejandro Celaya
2023-01-15 13:08:21 +01:00
parent fdadf3ba07
commit a93edf158e
22 changed files with 142 additions and 98 deletions

View File

@@ -147,12 +147,9 @@ class ApiKey extends AbstractEntity
$meta = $roleDefinition->meta;
if ($this->hasRole($role)) {
/** @var ApiKeyRole $apiKeyRole */
$apiKeyRole = $this->roles->get($role->value);
$apiKeyRole->updateMeta($meta);
$this->roles->get($role->value)?->updateMeta($meta);
} else {
$apiKeyRole = new ApiKeyRole($roleDefinition->role, $roleDefinition->meta, $this);
$this->roles[$role->value] = $apiKeyRole;
$this->roles->set($role->value, new ApiKeyRole($role, $meta, $this));
}
}
}