mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 16:12:49 -05:00
SM-561: Update Secret Revision Dates (#2770)
* SM-561: Update secret revision date on restore * SM-561: Update secret revision dates when a project is deleted * SM-561: Fix bug when updating revision dates for secrets when their parent project is deleted * SM-561: Handle case when there are no secrets in the projects that are being deleted * SM-561: Rename func to GetManyWithSecretsByIds and move UpdateRevisionDates call from ProjectsController to projects delete command * SM-561: update secret ids before project deletion * SM-561: Refactor out command in command call to follow CQRS pattern * SM-561: Remove null check
This commit is contained in:
@ -111,7 +111,6 @@ public class ProjectsController : Controller
|
||||
public async Task<ListResponseModel<BulkDeleteResponseModel>> BulkDeleteAsync([FromBody] List<Guid> ids)
|
||||
{
|
||||
var userId = _userService.GetProperUserId(User).Value;
|
||||
|
||||
var results = await _deleteProjectCommand.DeleteProjects(ids, userId);
|
||||
var responses = results.Select(r => new BulkDeleteResponseModel(r.Item1.Id, r.Item2));
|
||||
return new ListResponseModel<BulkDeleteResponseModel>(responses);
|
||||
|
@ -7,7 +7,7 @@ public interface IProjectRepository
|
||||
{
|
||||
Task<IEnumerable<Project>> GetManyByOrganizationIdAsync(Guid organizationId, Guid userId, AccessClientType accessType);
|
||||
Task<IEnumerable<Project>> GetManyByOrganizationIdWriteAccessAsync(Guid organizationId, Guid userId, AccessClientType accessType);
|
||||
Task<IEnumerable<Project>> GetManyByIds(IEnumerable<Guid> ids);
|
||||
Task<IEnumerable<Project>> GetManyWithSecretsByIds(IEnumerable<Guid> ids);
|
||||
Task<Project> GetByIdAsync(Guid id);
|
||||
Task<Project> CreateAsync(Project project);
|
||||
Task ReplaceAsync(Project project);
|
||||
|
@ -17,4 +17,5 @@ public interface ISecretRepository
|
||||
Task HardDeleteManyByIdAsync(IEnumerable<Guid> ids);
|
||||
Task RestoreManyByIdAsync(IEnumerable<Guid> ids);
|
||||
Task<IEnumerable<Secret>> ImportAsync(IEnumerable<Secret> secrets);
|
||||
Task UpdateRevisionDates(IEnumerable<Guid> ids);
|
||||
}
|
||||
|
Reference in New Issue
Block a user