Files
medusa-store/docs/content/references/js-client/classes/AdminCollectionsResource.md
Shahed Nasser 3b28f46705 docs: added reference for JS Client (#1629)
* added reference for JS Client

* added reference for JS Client

* added reference for JS Client
2022-07-08 18:21:46 +03:00

4.3 KiB

Class: AdminCollectionsResource

Hierarchy

  • default

    AdminCollectionsResource

Methods

create

create(payload, customHeaders?): ResponsePromise<AdminCollectionsRes>

description Creates a collection.

Parameters

Name Type
payload AdminPostCollectionsReq
customHeaders Record<string, any>

Returns

ResponsePromise<AdminCollectionsRes>

Created collection.

Defined in

packages/medusa-js/src/resources/admin/collections.ts:20


delete

delete(id, customHeaders?): ResponsePromise<DeleteResponse>

description deletes a collection

Parameters

Name Type Description
id string id of collection to delete.
customHeaders Record<string, any>

Returns

ResponsePromise<DeleteResponse>

Deleted response

Defined in

packages/medusa-js/src/resources/admin/collections.ts:50


list

list(query?, customHeaders?): ResponsePromise<AdminCollectionsListRes>

description Lists collections matching a query

Parameters

Name Type Description
query? AdminGetCollectionsParams Query for searching collections
customHeaders Record<string, any>

Returns

ResponsePromise<AdminCollectionsListRes>

a list of collections matching the query.

Defined in

packages/medusa-js/src/resources/admin/collections.ts:72


retrieve

retrieve(id, customHeaders?): ResponsePromise<AdminCollectionsRes>

description get a collection

Parameters

Name Type Description
id string id of the collection to retrieve.
customHeaders Record<string, any>

Returns

ResponsePromise<AdminCollectionsRes>

the collection with the given id

Defined in

packages/medusa-js/src/resources/admin/collections.ts:61


update

update(id, payload, customHeaders?): ResponsePromise<AdminCollectionsRes>

description Updates a collection

Parameters

Name Type Description
id string id of the collection to update.
payload AdminPostCollectionsCollectionReq update to apply to collection.
customHeaders Record<string, any>

Returns

ResponsePromise<AdminCollectionsRes>

the updated collection.

Defined in

packages/medusa-js/src/resources/admin/collections.ts:35