1
0
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:
Matt Gibson
2021-03-29 08:18:07 -05:00
committed by GitHub
parent d71bd092ef
commit 5c961ce847
3 changed files with 6 additions and 6 deletions

View File

@@ -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]);