1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-06 09:10:50 +01:00

Update revision date from server on restore (#1211)

This commit is contained in:
Matt Gibson 2021-01-08 08:53:45 -06:00 committed by GitHub
parent 3b5cae01e0
commit ca7794e6f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -40,7 +40,7 @@ namespace Bit.Core.Abstractions
Task<FolderResponse> PutFolderAsync(string id, FolderRequest request);
Task<CipherResponse> PutShareCipherAsync(string id, CipherShareRequest request);
Task PutDeleteCipherAsync(string id);
Task PutRestoreCipherAsync(string id);
Task<CipherResponse> PutRestoreCipherAsync(string id);
Task RefreshIdentityTokenAsync();
Task<object> PreValidateSso(string identifier);
Task<TResponse> SendAsync<TRequest, TResponse>(HttpMethod method, string path,

View File

@ -262,9 +262,9 @@ namespace Bit.Core.Services
return SendAsync<object, object>(HttpMethod.Put, string.Concat("/ciphers/", id, "/delete"), null, true, false);
}
public Task PutRestoreCipherAsync(string id)
public Task<CipherResponse> PutRestoreCipherAsync(string id)
{
return SendAsync<object, object>(HttpMethod.Put, string.Concat("/ciphers/", id, "/restore"), null, true, false);
return SendAsync<object, CipherResponse>(HttpMethod.Put, string.Concat("/ciphers/", id, "/restore"), null, true, true);
}
#endregion

View File

@ -760,8 +760,9 @@ namespace Bit.Core.Services
{
return;
}
await _apiService.PutRestoreCipherAsync(id);
var response = await _apiService.PutRestoreCipherAsync(id);
ciphers[id].DeletedDate = null;
ciphers[id].RevisionDate = response.RevisionDate;
await _storageService.SaveAsync(cipherKey, ciphers);
await ClearCacheAsync();
}