hotfix(medusa): Remove atomicPhase from product retrieve
This commit is contained in:
@@ -143,20 +143,20 @@ class ProductService extends BaseService {
|
|||||||
* @return {Promise<Product>} the result of the find one operation.
|
* @return {Promise<Product>} the result of the find one operation.
|
||||||
*/
|
*/
|
||||||
async retrieve(productId, config = {}) {
|
async retrieve(productId, config = {}) {
|
||||||
return this.atomicPhase_(async manager => {
|
const productRepo = this.manager_.getCustomRepository(
|
||||||
const productRepo = manager.getCustomRepository(this.productRepository_)
|
this.productRepository_
|
||||||
const validatedId = this.validateId_(productId)
|
)
|
||||||
const query = this.buildQuery_({ id: validatedId }, config)
|
const validatedId = this.validateId_(productId)
|
||||||
const product = await productRepo.findOne(query)
|
const query = this.buildQuery_({ id: validatedId }, config)
|
||||||
if (!product) {
|
const product = await productRepo.findOne(query)
|
||||||
throw new MedusaError(
|
if (!product) {
|
||||||
MedusaError.Types.NOT_FOUND,
|
throw new MedusaError(
|
||||||
`Product with id: ${productId} was not found`
|
MedusaError.Types.NOT_FOUND,
|
||||||
)
|
`Product with id: ${productId} was not found`
|
||||||
}
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return product
|
return product
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user