mirror of
https://github.com/bitwarden/server.git
synced 2024-12-30 18:17:36 +01:00
remove unnecessary update partial cipher service
This commit is contained in:
parent
f7aa6fadbf
commit
3459be8143
@ -136,7 +136,7 @@ namespace Bit.Api.Controllers
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
||||
await _cipherService.UpdatePartialAsync(new Guid(id), userId, cipher.FolderId, !cipher.Favorite);
|
||||
await _cipherRepository.UpdatePartialAsync(new Guid(id), userId, cipher.FolderId, !cipher.Favorite);
|
||||
}
|
||||
|
||||
[HttpPut("{id}/partial")]
|
||||
@ -145,7 +145,7 @@ namespace Bit.Api.Controllers
|
||||
{
|
||||
var userId = _userService.GetProperUserId(User).Value;
|
||||
var folderId = string.IsNullOrWhiteSpace(model.FolderId) ? null : (Guid?)new Guid(model.FolderId);
|
||||
await _cipherService.UpdatePartialAsync(new Guid(id), userId, folderId, model.Favorite);
|
||||
await _cipherRepository.UpdatePartialAsync(new Guid(id), userId, folderId, model.Favorite);
|
||||
}
|
||||
|
||||
[HttpPut("{id}/share")]
|
||||
|
@ -9,7 +9,6 @@ namespace Bit.Core.Services
|
||||
public interface ICipherService
|
||||
{
|
||||
Task SaveAsync(CipherDetails cipher, Guid savingUserId);
|
||||
Task UpdatePartialAsync(Guid cipherId, Guid savingUserId, Guid? folderId, bool favorite);
|
||||
Task DeleteAsync(CipherDetails cipher, Guid deletingUserId);
|
||||
Task SaveFolderAsync(Folder folder);
|
||||
Task DeleteFolderAsync(Folder folder);
|
||||
|
@ -65,16 +65,6 @@ namespace Bit.Core.Services
|
||||
}
|
||||
}
|
||||
|
||||
public async Task UpdatePartialAsync(Guid cipherId, Guid savingUserId, Guid? folderId, bool favorite)
|
||||
{
|
||||
if(!(await UserCanPartialEditAsync(cipherId, savingUserId)))
|
||||
{
|
||||
throw new BadRequestException("Cannot edit.");
|
||||
}
|
||||
|
||||
await _cipherRepository.UpdatePartialAsync(cipherId, savingUserId, folderId, favorite);
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(CipherDetails cipher, Guid deletingUserId)
|
||||
{
|
||||
if(!(await UserCanEditAsync(cipher, deletingUserId)))
|
||||
@ -225,13 +215,5 @@ namespace Bit.Core.Services
|
||||
|
||||
return await _subvaultUserRepository.GetCanEditByUserIdCipherIdAsync(userId, cipher.Id);
|
||||
}
|
||||
|
||||
private Task<bool> UserCanPartialEditAsync(Guid cipherId, Guid userId)
|
||||
{
|
||||
// TODO: implement
|
||||
|
||||
return Task.FromResult(true);
|
||||
//return await _subvaultUserRepository.GetCanEditByUserIdCipherIdAsync(userId, cipherId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user