[PM-17562] Add GET endpoints for event integrations (#6104)

* [PM-17562] Add GET endpoints for event integrations

* Default to null for Service

* Respond to PR Feedback
This commit is contained in:
Brant DeBow
2025-07-23 14:24:59 -04:00
committed by GitHub
parent 829c3ed1d7
commit 988b994624
17 changed files with 402 additions and 4 deletions

View File

@@ -18,6 +18,27 @@ public class OrganizationIntegrationConfigurationController(
IOrganizationIntegrationRepository integrationRepository,
IOrganizationIntegrationConfigurationRepository integrationConfigurationRepository) : Controller
{
[HttpGet("")]
public async Task<List<OrganizationIntegrationConfigurationResponseModel>> GetAsync(
Guid organizationId,
Guid integrationId)
{
if (!await HasPermission(organizationId))
{
throw new NotFoundException();
}
var integration = await integrationRepository.GetByIdAsync(integrationId);
if (integration == null || integration.OrganizationId != organizationId)
{
throw new NotFoundException();
}
var configurations = await integrationConfigurationRepository.GetManyByIntegrationAsync(integrationId);
return configurations
.Select(configuration => new OrganizationIntegrationConfigurationResponseModel(configuration))
.ToList();
}
[HttpPost("")]
public async Task<OrganizationIntegrationConfigurationResponseModel> CreateAsync(
Guid organizationId,