fix: api/routes/store/products pass linting (#644)

This commit is contained in:
timothy22000
2021-10-25 08:18:29 +02:00
committed by GitHub
parent f4307c702a
commit 2966242bc8
3 changed files with 27 additions and 37 deletions
-1
View File
@@ -50,7 +50,6 @@
/packages/medusa/src/api/routes/store/auth /packages/medusa/src/api/routes/store/auth
/packages/medusa/src/api/routes/store/carts /packages/medusa/src/api/routes/store/carts
/packages/medusa/src/api/routes/store/customers /packages/medusa/src/api/routes/store/customers
/packages/medusa/src/api/routes/store/products
/packages/medusa/src/api/routes/store/regions /packages/medusa/src/api/routes/store/regions
/packages/medusa/src/api/routes/store/return-reasons /packages/medusa/src/api/routes/store/return-reasons
@@ -1,4 +1,3 @@
import { MedusaError, Validator } from "medusa-core-utils"
import { defaultRelations } from "." import { defaultRelations } from "."
/** /**
@@ -30,7 +29,6 @@ import { defaultRelations } from "."
* $ref: "#/components/schemas/product" * $ref: "#/components/schemas/product"
*/ */
export default async (req, res) => { export default async (req, res) => {
try {
const productService = req.scope.resolve("productService") const productService = req.scope.resolve("productService")
const limit = parseInt(req.query.limit) || 100 const limit = parseInt(req.query.limit) || 100
@@ -53,7 +51,4 @@ export default async (req, res) => {
const products = await productService.list(selector, listConfig) const products = await productService.list(selector, listConfig)
res.json({ products, count: products.length, offset, limit }) res.json({ products, count: products.length, offset, limit })
} catch (error) {
throw error
}
} }
@@ -16,7 +16,6 @@ export default async (req, res) => {
throw new MedusaError(MedusaError.Types.INVALID_DATA, error.details) throw new MedusaError(MedusaError.Types.INVALID_DATA, error.details)
} }
try {
const { q, offset, limit, filter, ...options } = value const { q, offset, limit, filter, ...options } = value
const paginationOptions = { offset, limit } const paginationOptions = { offset, limit }
@@ -29,7 +28,4 @@ export default async (req, res) => {
}) })
res.status(200).send(results) res.status(200).send(results)
} catch (error) {
throw error
}
} }