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:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user