diff --git a/apps/web/src/app/vault/core/collection-admin.service.ts b/apps/web/src/app/vault/core/collection-admin.service.ts index 5cdc3ff50d..20649bd3f9 100644 --- a/apps/web/src/app/vault/core/collection-admin.service.ts +++ b/apps/web/src/app/vault/core/collection-admin.service.ts @@ -7,6 +7,7 @@ import { EncString } from "@bitwarden/common/platform/models/domain/enc-string"; import { CollectionRequest } from "@bitwarden/common/vault/models/request/collection.request"; import { CollectionAccessDetailsResponse, + CollectionDetailsResponse, CollectionResponse, } from "@bitwarden/common/vault/models/response/collection.response"; @@ -51,10 +52,10 @@ export class CollectionAdminService { return view; } - async save(collection: CollectionAdminView): Promise { + async save(collection: CollectionAdminView): Promise { const request = await this.encrypt(collection); - let response: CollectionResponse; + let response: CollectionDetailsResponse; if (collection.id == null) { response = await this.apiService.postCollection(collection.organizationId, request); collection.id = response.id; diff --git a/libs/common/src/abstractions/api.service.ts b/libs/common/src/abstractions/api.service.ts index 060e87759c..2ef6b327d3 100644 --- a/libs/common/src/abstractions/api.service.ts +++ b/libs/common/src/abstractions/api.service.ts @@ -122,6 +122,7 @@ import { AttachmentResponse } from "../vault/models/response/attachment.response import { CipherResponse } from "../vault/models/response/cipher.response"; import { CollectionAccessDetailsResponse, + CollectionDetailsResponse, CollectionResponse, } from "../vault/models/response/collection.response"; import { SyncResponse } from "../vault/models/response/sync.response"; @@ -277,7 +278,7 @@ export abstract class ApiService { postCollection: ( organizationId: string, request: CollectionRequest, - ) => Promise; + ) => Promise; putCollectionUsers: ( organizationId: string, id: string, @@ -287,7 +288,7 @@ export abstract class ApiService { organizationId: string, id: string, request: CollectionRequest, - ) => Promise; + ) => Promise; deleteCollection: (organizationId: string, id: string) => Promise; deleteManyCollections: (organizationId: string, collectionIds: string[]) => Promise; deleteCollectionUser: ( diff --git a/libs/common/src/services/api.service.ts b/libs/common/src/services/api.service.ts index d9ccf87a51..336191f3ab 100644 --- a/libs/common/src/services/api.service.ts +++ b/libs/common/src/services/api.service.ts @@ -133,6 +133,7 @@ import { AttachmentResponse } from "../vault/models/response/attachment.response import { CipherResponse } from "../vault/models/response/cipher.response"; import { CollectionAccessDetailsResponse, + CollectionDetailsResponse, CollectionResponse, } from "../vault/models/response/collection.response"; import { SyncResponse } from "../vault/models/response/sync.response"; @@ -770,7 +771,7 @@ export class ApiService implements ApiServiceAbstraction { async postCollection( organizationId: string, request: CollectionRequest, - ): Promise { + ): Promise { const r = await this.send( "POST", "/organizations/" + organizationId + "/collections", @@ -778,14 +779,14 @@ export class ApiService implements ApiServiceAbstraction { true, true, ); - return new CollectionResponse(r); + return new CollectionDetailsResponse(r); } async putCollection( organizationId: string, id: string, request: CollectionRequest, - ): Promise { + ): Promise { const r = await this.send( "PUT", "/organizations/" + organizationId + "/collections/" + id, @@ -793,7 +794,7 @@ export class ApiService implements ApiServiceAbstraction { true, true, ); - return new CollectionResponse(r); + return new CollectionDetailsResponse(r); } async putCollectionUsers(