Feat:contentful plugin archive on delete
* extend plugin with methods for archival in contentful * add events to services * rename entities * eventbusservice to delete * Update packages/medusa-plugin-contentful/src/services/contentful.js Co-authored-by: Sebastian Rindom <skrindom@gmail.com> * Update packages/medusa-plugin-contentful/src/services/contentful.js Co-authored-by: Sebastian Rindom <skrindom@gmail.com> * Update packages/medusa-plugin-contentful/src/services/contentful.js Co-authored-by: Sebastian Rindom <skrindom@gmail.com> * testing * adjust options * Update packages/medusa-plugin-contentful/src/services/contentful.js Co-authored-by: Sebastian Rindom <skrindom@gmail.com> * adjust options * Update packages/medusa-plugin-contentful/src/services/contentful.js Co-authored-by: Sebastian Rindom <skrindom@gmail.com> * Update packages/medusa-plugin-contentful/src/services/contentful.js Co-authored-by: Sebastian Rindom <skrindom@gmail.com> Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
This commit is contained in:
co-authored by
Sebastian Rindom
parent
62fda1043e
commit
ba2de6906a
@@ -18,10 +18,18 @@ class ContentfulSubscriber {
|
||||
await this.contentfulService_.updateRegionInContentful(data)
|
||||
})
|
||||
|
||||
this.eventBus_.subscribe("region.deleted", async (data) => {
|
||||
await this.contentfulService_.updateRegionInContentful(data)
|
||||
})
|
||||
|
||||
this.eventBus_.subscribe("product-variant.updated", async (data) => {
|
||||
await this.contentfulService_.updateProductVariantInContentful(data)
|
||||
})
|
||||
|
||||
this.eventBus_.subscribe("product-variant.deleted", async (data) => {
|
||||
await this.contentfulService_.archiveProductVariantInContentful(data)
|
||||
})
|
||||
|
||||
this.eventBus_.subscribe("product.updated", async (data) => {
|
||||
await this.contentfulService_.updateProductInContentful(data)
|
||||
})
|
||||
@@ -29,6 +37,10 @@ class ContentfulSubscriber {
|
||||
this.eventBus_.subscribe("product.created", async (data) => {
|
||||
await this.contentfulService_.createProductInContentful(data)
|
||||
})
|
||||
|
||||
this.eventBus_.subscribe("product.deleted", async (data) => {
|
||||
await this.contentfulService_.archiveProductInContentful(data)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user