mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-16 01:21:48 +01:00
[EC-584] Fixed OrganizationExportResponse to correctly parse data (#3641)
* [EC-584] Fixed OrganizationExportResponse to correctly parse data and use CollectionResponse and CipherResponse constructors * [EC-584] Removed ListResponse from OrganizationExportResponse properties * Bumped web version to 2022.10.3 (#3957) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Revert "Bumped web version to 2022.10.3 (#3957)" This reverts commit5d8d547cd2
. * Web version bump to 2022.11.0 for QA testing * Revert "Web version bump to 2022.11.0 for QA testing" This reverts commit484db431ed
. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Joseph Flinn <joseph.s.flinn@gmail.com>
This commit is contained in:
parent
60e7acba4e
commit
4afe0f5d89
@ -1,15 +1,20 @@
|
||||
import { BaseResponse } from "./base.response";
|
||||
import { CipherResponse } from "./cipher.response";
|
||||
import { CollectionResponse } from "./collection.response";
|
||||
import { ListResponse } from "./list.response";
|
||||
|
||||
export class OrganizationExportResponse extends BaseResponse {
|
||||
collections: ListResponse<CollectionResponse>;
|
||||
ciphers: ListResponse<CipherResponse>;
|
||||
collections: CollectionResponse[];
|
||||
ciphers: CipherResponse[];
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
this.collections = this.getResponseProperty("Collections");
|
||||
this.ciphers = this.getResponseProperty("Ciphers");
|
||||
const collections = this.getResponseProperty("Collections");
|
||||
if (collections != null) {
|
||||
this.collections = collections.map((c: any) => new CollectionResponse(c));
|
||||
}
|
||||
const ciphers = this.getResponseProperty("Ciphers");
|
||||
if (ciphers != null) {
|
||||
this.ciphers = ciphers.map((c: any) => new CipherResponse(c));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -248,12 +248,8 @@ export class ExportService implements ExportServiceAbstraction {
|
||||
this.apiService.getOrganizationExport(organizationId).then((exportData) => {
|
||||
const exportPromises: any = [];
|
||||
if (exportData != null) {
|
||||
if (
|
||||
exportData.collections != null &&
|
||||
exportData.collections.data != null &&
|
||||
exportData.collections.data.length > 0
|
||||
) {
|
||||
exportData.collections.data.forEach((c) => {
|
||||
if (exportData.collections != null && exportData.collections.length > 0) {
|
||||
exportData.collections.forEach((c) => {
|
||||
const collection = new Collection(new CollectionData(c as CollectionDetailsResponse));
|
||||
exportPromises.push(
|
||||
collection.decrypt().then((decCol) => {
|
||||
@ -262,12 +258,8 @@ export class ExportService implements ExportServiceAbstraction {
|
||||
);
|
||||
});
|
||||
}
|
||||
if (
|
||||
exportData.ciphers != null &&
|
||||
exportData.ciphers.data != null &&
|
||||
exportData.ciphers.data.length > 0
|
||||
) {
|
||||
exportData.ciphers.data
|
||||
if (exportData.ciphers != null && exportData.ciphers.length > 0) {
|
||||
exportData.ciphers
|
||||
.filter((c) => c.deletedDate === null)
|
||||
.forEach((c) => {
|
||||
const cipher = new Cipher(new CipherData(c));
|
||||
|
Loading…
Reference in New Issue
Block a user