mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 00:33:44 +00:00
Await file upload service (#314)
* Await file upload service * Await file deletion on exception for file upload
This commit is contained in:
@@ -631,7 +631,7 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
try {
|
||||
const uploadDataResponse = await this.apiService.postCipherAttachment(cipher.id, request);
|
||||
response = admin ? uploadDataResponse.cipherMiniResponse : uploadDataResponse.cipherResponse;
|
||||
this.fileUploadService.uploadCipherAttachment(admin, uploadDataResponse, filename, data);
|
||||
await this.fileUploadService.uploadCipherAttachment(admin, uploadDataResponse, filename, data);
|
||||
} catch (e) {
|
||||
if (e instanceof ErrorResponse && (e as ErrorResponse).statusCode === 404 || (e as ErrorResponse).statusCode === 405) {
|
||||
response = await this.legacyServerAttachmentFileUpload(admin, cipher.id, encFileName, encData, dataEncKey[1]);
|
||||
|
||||
Reference in New Issue
Block a user