mirror of
https://github.com/bitwarden/server.git
synced 2026-02-01 22:53:12 +08:00
* Add Microsoft Teams integration * Fix method naming error * Expand and clean up unit test coverage * Update with PR feedback * Add documentation, add In Progress logic/tests for Teams * Fixed lowercase Slack * Added docs; Updated PR suggestions; * Fix broken tests
37 lines
1.3 KiB
C#
37 lines
1.3 KiB
C#
using Bit.Core.AdminConsole.Entities;
|
|
using Bit.Core.Enums;
|
|
using Bit.Infrastructure.EntityFramework.Repositories;
|
|
using Bit.Infrastructure.EntityFramework.Repositories.Queries;
|
|
|
|
namespace Bit.Infrastructure.EntityFramework.AdminConsole.Repositories.Queries;
|
|
|
|
public class OrganizationIntegrationReadByTeamsConfigurationTenantIdTeamIdQuery : IQuery<OrganizationIntegration>
|
|
{
|
|
private readonly string _tenantId;
|
|
private readonly string _teamId;
|
|
|
|
public OrganizationIntegrationReadByTeamsConfigurationTenantIdTeamIdQuery(string tenantId, string teamId)
|
|
{
|
|
_tenantId = tenantId;
|
|
_teamId = teamId;
|
|
}
|
|
|
|
public IQueryable<OrganizationIntegration> Run(DatabaseContext dbContext)
|
|
{
|
|
var query =
|
|
from oi in dbContext.OrganizationIntegrations
|
|
where oi.Type == IntegrationType.Teams &&
|
|
oi.Configuration != null &&
|
|
oi.Configuration.Contains($"\"TenantId\":\"{_tenantId}\"") &&
|
|
oi.Configuration.Contains($"\"id\":\"{_teamId}\"")
|
|
select new OrganizationIntegration()
|
|
{
|
|
Id = oi.Id,
|
|
OrganizationId = oi.OrganizationId,
|
|
Type = oi.Type,
|
|
Configuration = oi.Configuration,
|
|
};
|
|
return query;
|
|
}
|
|
}
|