1
0
mirror of https://github.com/bitwarden/server synced 2026-02-06 03:33:43 +00:00

Add database support for handling OrganizationConnection migration

This commit is contained in:
Brant DeBow
2025-12-31 16:43:59 -05:00
parent 484a8e42dc
commit 2511591449
6 changed files with 91 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
using AutoMapper;
using Bit.Core.Dirt.Enums;
using Bit.Core.Dirt.Repositories;
using Bit.Infrastructure.EntityFramework.Dirt.Repositories.Queries;
using Bit.Infrastructure.EntityFramework.Repositories;
@@ -38,4 +39,14 @@ public class OrganizationIntegrationRepository :
return await query.Run(dbContext).SingleOrDefaultAsync();
}
}
public async Task<OrganizationIntegration?> GetByOrganizationIdTypeAsync(Guid organizationId, IntegrationType type)
{
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var query = new OrganizationIntegrationReadByOrganizationIdTypeQuery(organizationId, type);
return await query.Run(dbContext).SingleOrDefaultAsync();
}
}
}