-
Notifications
You must be signed in to change notification settings - Fork 7
Migration Guide V4 to V5
Enes Kutay SEZEN edited this page Dec 21, 2024
·
1 revision
The main breaking change in V5 is in the catalog module, specifically how certain functions resolve their Promises. If you are not using the affected functions in the catalog module, you can upgrade to V5 without any changes.
The following functions in the catalog module now return a Promise that resolves with an object containing task information, instead of resolving with void:
createOrReplaceItemsupdateItemsdeleteItemscreateOrReplaceVariationsupdateVariationsdeleteVariations
Previously (V4):
constructorio.catalog.createOrReplaceItems({ items: [...] }).then(() => {});Now (V5):
constructorio.catalog.createOrReplaceItems({ items: [...] })
.then((response) => {
console.log(response.task_id);
console.log(response.task_status_path);
});The response object will have the following structure (example):
{
"task_id": "your_task_id",
"task_status_path": "/v1/tasks/your_task_id"
}