hotfix(medusa): wrap update-product in transaction (#182)
This commit is contained in:
@@ -90,8 +90,11 @@ export default async (req, res) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const productService = req.scope.resolve("productService")
|
const productService = req.scope.resolve("productService")
|
||||||
|
const entityManager = req.scope.resolve("manager")
|
||||||
|
|
||||||
await productService.update(id, value)
|
await entityManager.transaction(async manager => {
|
||||||
|
await productService.withTransaction(manager).update(id, value)
|
||||||
|
})
|
||||||
|
|
||||||
const product = await productService.retrieve(id, {
|
const product = await productService.retrieve(id, {
|
||||||
select: defaultFields,
|
select: defaultFields,
|
||||||
|
|||||||
Reference in New Issue
Block a user