From d0e7ebdcf11c0f719593cd482b2114a7c021b405 Mon Sep 17 00:00:00 2001 From: olivermrbl Date: Tue, 23 Feb 2021 12:49:46 +0100 Subject: [PATCH] hotfix(medusa): Remove atomicPhase from product retrieve --- packages/medusa/src/services/product.js | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/medusa/src/services/product.js b/packages/medusa/src/services/product.js index 7e38385f2a..1c9e32d6c3 100644 --- a/packages/medusa/src/services/product.js +++ b/packages/medusa/src/services/product.js @@ -143,20 +143,20 @@ class ProductService extends BaseService { * @return {Promise} the result of the find one operation. */ async retrieve(productId, config = {}) { - return this.atomicPhase_(async manager => { - const productRepo = manager.getCustomRepository(this.productRepository_) - const validatedId = this.validateId_(productId) - const query = this.buildQuery_({ id: validatedId }, config) - const product = await productRepo.findOne(query) - if (!product) { - throw new MedusaError( - MedusaError.Types.NOT_FOUND, - `Product with id: ${productId} was not found` - ) - } + const productRepo = this.manager_.getCustomRepository( + this.productRepository_ + ) + const validatedId = this.validateId_(productId) + const query = this.buildQuery_({ id: validatedId }, config) + const product = await productRepo.findOne(query) + if (!product) { + throw new MedusaError( + MedusaError.Types.NOT_FOUND, + `Product with id: ${productId} was not found` + ) + } - return product - }) + return product } /**