public async Task <ActionResult <ApiKey> > UpdateApiKey(string apiKeyId, [FromBody] ApiKey apiKey) { apiKey = apiKey with { Id = apiKeyId }; var apiKeyResult = await _apiKeyService.UpdateAsync(apiKey); if (apiKeyResult == null) { return(NotFound(apiKeyId)); } var tenant = HttpContext.GetTenant(); await PublishApiKeyChangeEventAsync(TopicType.Modify, apiKeyResult, tenant !.Id !); return(AcceptedAtAction(nameof(FindOne), new { id = apiKey.Id }, apiKeyResult)); }
public async Task UpdateAsync(string key, UpdateApiKeyRequest request) => await _service.UpdateAsync(key, request);