updateCollection
Update an existing product collection.
Import
import { updateCollection } from "@evershop/evershop/catalog/services";
Syntax
updateCollection(uuid: string, data: CollectionData, context?: Record<string, any>): Promise<Collection>
Parameters
uuid
Type: string
Collection UUID to update.
data
Type: CollectionData
Collection data to update. All fields are optional.
context
Type: Record<string, any> (optional)
Context object for hooks.
Return Value
Returns Promise<Collection> with updated collection data.
Examples
Update Name
import { updateCollection } from "@evershop/evershop/catalog/services";
await updateCollection('collection-uuid-123', {
name: "Updated Collection Name"
});
Update Multiple Fields
import { updateCollection } from "@evershop/evershop/catalog/services";
const updated = await updateCollection('collection-uuid-123', {
name: "Winter Sale",
description: "Winter collection items on sale"
});
See Also
- createCollection - Create collection
- deleteCollection - Delete collection