Files
medusa-store/docs/content/references/services/classes/ProductCollectionService.md
Shahed Nasser 02d5c1da88 docs: update Typedoc and regenerate references (#1994)
* generated new services reference

* changed from automatic push to automated pull request

* updated typedoc, regenerated JS Client reference

* regenerated the reference after updating typedoc

* added action for js client
2022-08-04 17:29:52 +03:00

5.6 KiB

Class: ProductCollectionService

Provides layer to manipulate product collections.

Hierarchy

  • "medusa-interfaces"

    ProductCollectionService

Constructors

constructor

new ProductCollectionService(__namedParameters)

Parameters

Name Type
__namedParameters Object

Overrides

BaseService.constructor

Defined in

packages/medusa/src/services/product-collection.js:11

Methods

addProducts

addProducts(collectionId, productIds): Promise<any>

Parameters

Name Type
collectionId any
productIds any

Returns

Promise<any>

Defined in

packages/medusa/src/services/product-collection.js:170


create

create(collection): Promise<ProductCollection>

Creates a product collection

Parameters

Name Type Description
collection any the collection to create

Returns

Promise<ProductCollection>

created collection

Defined in

packages/medusa/src/services/product-collection.js:104


delete

delete(collectionId): Promise<any>

Deletes a product collection idempotently

Parameters

Name Type Description
collectionId string id of collection to delete

Returns

Promise<any>

empty promise

Defined in

packages/medusa/src/services/product-collection.js:152


list

list(selector?, config?): Promise<any>

Lists product collections

Parameters

Name Type Description
selector any the query object for find
config any the config to be used for find

Returns

Promise<any>

the result of the find operation

Defined in

packages/medusa/src/services/product-collection.js:206


listAndCount

listAndCount(selector?, config?): Promise<any>

Lists product collections and add count.

Parameters

Name Type Description
selector any the query object for find
config any the config to be used for find

Returns

Promise<any>

the result of the find operation

Defined in

packages/medusa/src/services/product-collection.js:221


removeProducts

removeProducts(collectionId, productIds): Promise<any>

Parameters

Name Type
collectionId any
productIds any

Returns

Promise<any>

Defined in

packages/medusa/src/services/product-collection.js:188


retrieve

retrieve(collectionId, config?): Promise<ProductCollection>

Retrieves a product collection by id.

Parameters

Name Type Description
collectionId string the id of the collection to retrieve.
config any the config of the collection to retrieve.

Returns

Promise<ProductCollection>

the collection.

Defined in

packages/medusa/src/services/product-collection.js:55


retrieveByHandle

retrieveByHandle(collectionHandle, config?): Promise<ProductCollection>

Retrieves a product collection by id.

Parameters

Name Type Description
collectionHandle string the handle of the collection to retrieve.
config any query config for request

Returns

Promise<ProductCollection>

the collection.

Defined in

packages/medusa/src/services/product-collection.js:81


update

update(collectionId, update): Promise<ProductCollection>

Updates a product collection

Parameters

Name Type Description
collectionId string id of collection to update
update any update object

Returns

Promise<ProductCollection>

update collection

Defined in

packages/medusa/src/services/product-collection.js:125


withTransaction

withTransaction(transactionManager): ProductCollectionService

Parameters

Name Type
transactionManager any

Returns

ProductCollectionService

Defined in

packages/medusa/src/services/product-collection.js:32