fix: make /swaps pass eslint (#665)

This commit is contained in:
Luca Pizzini authored and GitHub committed 2021-10-25 19:52:26 +02:00
1 parent 40ad748cc3
commit 623d5f2b6d
4 files changed
+1 -12

No files matched your search

-1
View File
@@ -42,7 +42,6 @@
/packages/medusa/src/api/routes/admin/shipping-options
/packages/medusa/src/api/routes/admin/shipping-profiles
/packages/medusa/src/api/routes/admin/store
/packages/medusa/src/api/routes/admin/swaps
/packages/medusa/src/api/routes/admin/users
@@ -22,7 +22,6 @@ import { defaultFields, defaultRelations } from "./"
export default async (req, res) => {
const { id } = req.params
try {
const swapService = req.scope.resolve("swapService")
const swap = await swapService.retrieve(id, {
@@ -31,7 +30,4 @@ export default async (req, res) => {
})
res.json({ swap })
} catch (error) {
throw error
}
}
@@ -3,7 +3,7 @@ import middlewares from "../../../middlewares"
const route = Router()
export default app => {
export default (app) => {
app.use("/swaps", route)
/**
@@ -1,5 +1,3 @@
import _ from "lodash"
/**
* @oas [get] /swaps
* operationId: "GetSwaps"
@@ -20,7 +18,6 @@ import _ from "lodash"
* $ref: "#/components/schemas/swap"
*/
export default async (req, res) => {
try {
const swapService = req.scope.resolve("swapService")
const limit = parseInt(req.query.limit) || 50
@@ -37,7 +34,4 @@ export default async (req, res) => {
const swaps = await swapService.list(selector, { ...listConfig })
res.json({ swaps, count: swaps.length, offset, limit })
} catch (error) {
throw error
}
}