mirror of
https://github.com/bitwarden/server
synced 2026-01-07 19:13:50 +00:00
rollback share if errors
This commit is contained in:
@@ -8,5 +8,6 @@ namespace Bit.Core.Repositories
|
||||
public interface IOrganizationRepository : IRepository<Organization, Guid>
|
||||
{
|
||||
Task<ICollection<Organization>> GetManyByUserIdAsync(Guid userId);
|
||||
Task UpdateStorageAsync(Guid id, long storageIncrease);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,5 +9,6 @@ namespace Bit.Core.Repositories
|
||||
Task<User> GetByEmailAsync(string email);
|
||||
Task<string> GetPublicKeyAsync(Guid id);
|
||||
Task<DateTime> GetAccountRevisionDateAsync(Guid id);
|
||||
Task UpdateStorageAsync(Guid id, long storageIncrease);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,5 +31,17 @@ namespace Bit.Core.Repositories.SqlServer
|
||||
return results.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task UpdateStorageAsync(Guid id, long storageIncrease)
|
||||
{
|
||||
using(var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
await connection.ExecuteAsync(
|
||||
"[dbo].[Organization_UpdateStorage]",
|
||||
new { Id = id, StorageIncrease = storageIncrease },
|
||||
commandType: CommandType.StoredProcedure,
|
||||
commandTimeout: 180);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,5 +78,17 @@ namespace Bit.Core.Repositories.SqlServer
|
||||
commandTimeout: 180);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task UpdateStorageAsync(Guid id, long storageIncrease)
|
||||
{
|
||||
using(var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
await connection.ExecuteAsync(
|
||||
$"[{Schema}].[{Table}_UpdateStorage]",
|
||||
new { Id = id, StorageIncrease = storageIncrease },
|
||||
commandType: CommandType.StoredProcedure,
|
||||
commandTimeout: 180);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user