feat(workflows):product handlers should be reusable in different context (#4703)
**What** The listProducts handler should not be specific to the workflow. Same for the product removal, shouldn't expect an entire DTO but just a collection of object that at least contains the id. Same principle applied to other product handlers
This commit is contained in:
committed by
GitHub
parent
b396168dfd
commit
8ae31aff4b
@@ -275,10 +275,16 @@ const handlers = new Map([
|
||||
},
|
||||
{
|
||||
from: Actions.createProducts,
|
||||
alias: ProductHandlers.listProducts.aliases.products,
|
||||
alias: "products",
|
||||
},
|
||||
],
|
||||
},
|
||||
async ({ data }) => {
|
||||
return {
|
||||
alias: ProductHandlers.listProducts.aliases.ids,
|
||||
value: data.products.map((product) => product.id),
|
||||
}
|
||||
},
|
||||
aggregateData(),
|
||||
ProductHandlers.listProducts
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user