fix: make api/routes/admin/apps pass eslint (#641)
This commit is contained in:
@@ -21,7 +21,6 @@
|
|||||||
/packages/medusa/src/loaders/repositories.js
|
/packages/medusa/src/loaders/repositories.js
|
||||||
/packages/medusa/src/loaders/services.js
|
/packages/medusa/src/loaders/services.js
|
||||||
/packages/medusa/src/loaders/subscribers.js
|
/packages/medusa/src/loaders/subscribers.js
|
||||||
/packages/medusa/src/api/routes/admin/apps
|
|
||||||
/packages/medusa/src/api/routes/admin/auth
|
/packages/medusa/src/api/routes/admin/auth
|
||||||
/packages/medusa/src/api/routes/admin/collections
|
/packages/medusa/src/api/routes/admin/collections
|
||||||
/packages/medusa/src/api/routes/admin/notes
|
/packages/medusa/src/api/routes/admin/notes
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export default async (req, res) => {
|
|||||||
if (error) {
|
if (error) {
|
||||||
throw new MedusaError(MedusaError.Types.INVALID_DATA, error.details)
|
throw new MedusaError(MedusaError.Types.INVALID_DATA, error.details)
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
const oauthService = req.scope.resolve("oauthService")
|
const oauthService = req.scope.resolve("oauthService")
|
||||||
const data = await oauthService.generateToken(
|
const data = await oauthService.generateToken(
|
||||||
value.application_name,
|
value.application_name,
|
||||||
@@ -19,7 +18,4 @@ export default async (req, res) => {
|
|||||||
value.state
|
value.state
|
||||||
)
|
)
|
||||||
res.status(200).json({ apps: data })
|
res.status(200).json({ apps: data })
|
||||||
} catch (err) {
|
|
||||||
throw err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import middlewares from "../../../middlewares"
|
|||||||
|
|
||||||
const route = Router()
|
const route = Router()
|
||||||
|
|
||||||
export default app => {
|
export default (app) => {
|
||||||
app.use("/apps", route)
|
app.use("/apps", route)
|
||||||
|
|
||||||
route.get("/", middlewares.wrap(require("./list").default))
|
route.get("/", middlewares.wrap(require("./list").default))
|
||||||
|
|||||||
@@ -1,12 +1,6 @@
|
|||||||
import { MedusaError, Validator } from "medusa-core-utils"
|
|
||||||
|
|
||||||
export default async (req, res) => {
|
export default async (req, res) => {
|
||||||
try {
|
|
||||||
const oauthService = req.scope.resolve("oauthService")
|
const oauthService = req.scope.resolve("oauthService")
|
||||||
const data = await oauthService.list({})
|
const data = await oauthService.list({})
|
||||||
|
|
||||||
res.status(200).json({ apps: data })
|
res.status(200).json({ apps: data })
|
||||||
} catch (err) {
|
|
||||||
throw err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,7 @@ import ProductService from "../../../../services/product"
|
|||||||
export default async (req, res) => {
|
export default async (req, res) => {
|
||||||
const schema = Validator.object()
|
const schema = Validator.object()
|
||||||
.keys({
|
.keys({
|
||||||
q: Validator.string()
|
q: Validator.string().required().allow(""),
|
||||||
.required()
|
|
||||||
.allow(""),
|
|
||||||
offset: Validator.number().optional(),
|
offset: Validator.number().optional(),
|
||||||
limit: Validator.number().optional(),
|
limit: Validator.number().optional(),
|
||||||
filter: Validator.any(),
|
filter: Validator.any(),
|
||||||
|
|||||||
Reference in New Issue
Block a user