fix: /api/routes/store/auth pass linting (#645)

This commit is contained in:
timothy22000
2021-10-25 18:47:56 +01:00
committed by GitHub
parent 71561b0a61
commit 40ad748cc3
3 changed files with 9 additions and 15 deletions

View File

@@ -46,7 +46,7 @@
/packages/medusa/src/api/routes/admin/users
/packages/medusa/src/api/routes/store/auth
/packages/medusa/src/api/routes/store/carts
/packages/medusa/src/api/routes/store/regions

View File

@@ -1,5 +1,3 @@
import { Validator, MedusaError } from "medusa-core-utils"
/**
* @oas [get] /auth/{email}
* operationId: "GetAuthEmail"

View File

@@ -16,17 +16,13 @@
* $ref: "#/components/schemas/customer"
*/
export default async (req, res) => {
try {
if (req.user && req.user.customer_id) {
const customerService = req.scope.resolve("customerService")
const customer = await customerService.retrieve(req.user.customer_id, {
relations: ["shipping_addresses", "orders", "orders.items"],
})
res.json({ customer })
} else {
res.sendStatus(401)
}
} catch (err) {
throw err
if (req.user && req.user.customer_id) {
const customerService = req.scope.resolve("customerService")
const customer = await customerService.retrieve(req.user.customer_id, {
relations: ["shipping_addresses", "orders", "orders.items"],
})
res.json({ customer })
} else {
res.sendStatus(401)
}
}