cast fixes

This commit is contained in:
Kyle Spearrin 2018-07-06 12:55:59 -04:00
parent 93582da044
commit 06b32dc6ec
4 changed files with 8 additions and 4 deletions

2
jslib

@ -1 +1 @@
Subproject commit 2a526940fd4eefd2758ea654b0c7994e0ee12c4e Subproject commit b9a15d7ced6f5d44fe81ed2e441b5506159dcf85

View File

@ -9,6 +9,7 @@ import { CollectionService } from 'jslib/abstractions/collection.service';
import { CollectionData } from 'jslib/models/data/collectionData'; import { CollectionData } from 'jslib/models/data/collectionData';
import { Collection } from 'jslib/models/domain/collection'; import { Collection } from 'jslib/models/domain/collection';
import { CollectionDetailsResponse } from 'jslib/models/response/collectionResponse';
import { CollectionView } from 'jslib/models/view/collectionView'; import { CollectionView } from 'jslib/models/view/collectionView';
@Component({ @Component({
@ -33,7 +34,8 @@ export class CollectionsComponent implements OnInit {
async load() { async load() {
const response = await this.apiService.getCollections(this.organizationId); const response = await this.apiService.getCollections(this.organizationId);
const collections = response.data.map((r) => new Collection(new CollectionData(r))); const collections = response.data.map((r) =>
new Collection(new CollectionData(r as CollectionDetailsResponse)));
this.collections = await this.collectionService.decryptMany(collections); this.collections = await this.collectionService.decryptMany(collections);
this.loading = false; this.loading = false;
} }

View File

@ -6,7 +6,7 @@ import { ActivatedRoute } from '@angular/router';
import { ApiService } from 'jslib/abstractions/api.service'; import { ApiService } from 'jslib/abstractions/api.service';
import { GroupResponse } from 'jslib/models/response/groupUserResponse'; import { GroupResponse } from 'jslib/models/response/groupResponse';
@Component({ @Component({
selector: 'app-org-groups', selector: 'app-org-groups',

View File

@ -8,6 +8,7 @@ import { I18nService } from 'jslib/abstractions/i18n.service';
import { CollectionData } from 'jslib/models/data/collectionData'; import { CollectionData } from 'jslib/models/data/collectionData';
import { Collection } from 'jslib/models/domain/collection'; import { Collection } from 'jslib/models/domain/collection';
import { Organization } from 'jslib/models/domain/organization'; import { Organization } from 'jslib/models/domain/organization';
import { CollectionDetailsResponse } from 'jslib/models/response/collectionResponse';
import { CollectionView } from 'jslib/models/view/collectionView'; import { CollectionView } from 'jslib/models/view/collectionView';
import { GroupingsComponent as BaseGroupingsComponent } from '../../vault/groupings.component'; import { GroupingsComponent as BaseGroupingsComponent } from '../../vault/groupings.component';
@ -31,7 +32,8 @@ export class GroupingsComponent extends BaseGroupingsComponent {
} }
const collections = await this.apiService.getCollections(this.organization.id); const collections = await this.apiService.getCollections(this.organization.id);
if (collections != null && collections.data != null && collections.data.length) { if (collections != null && collections.data != null && collections.data.length) {
const collectionDomains = collections.data.map((r) => new Collection(new CollectionData(r))); const collectionDomains = collections.data.map((r) =>
new Collection(new CollectionData(r as CollectionDetailsResponse)));
this.collections = await this.collectionService.decryptMany(collectionDomains); this.collections = await this.collectionService.decryptMany(collectionDomains);
} else { } else {
this.collections = []; this.collections = [];