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

This commit is contained in:
timothy22000 authored and GitHub committed 2021-10-25 19:47:56 +02:00
1 parent 71561b0a61
commit 40ad748cc3
3 files changed
+9 -15

No files matched your search

+1 -1
View File
@@ -46,7 +46,7 @@
/packages/medusa/src/api/routes/admin/users /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/carts
/packages/medusa/src/api/routes/store/regions /packages/medusa/src/api/routes/store/regions
@@ -1,5 +1,3 @@
import { Validator, MedusaError } from "medusa-core-utils"
/** /**
* @oas [get] /auth/{email} * @oas [get] /auth/{email}
* operationId: "GetAuthEmail" * operationId: "GetAuthEmail"
@@ -16,17 +16,13 @@
* $ref: "#/components/schemas/customer" * $ref: "#/components/schemas/customer"
*/ */
export default async (req, res) => { export default async (req, res) => {
try { if (req.user && req.user.customer_id) {
if (req.user && req.user.customer_id) { const customerService = req.scope.resolve("customerService")
const customerService = req.scope.resolve("customerService") const customer = await customerService.retrieve(req.user.customer_id, {
const customer = await customerService.retrieve(req.user.customer_id, { relations: ["shipping_addresses", "orders", "orders.items"],
relations: ["shipping_addresses", "orders", "orders.items"], })
}) res.json({ customer })
res.json({ customer }) } else {
} else { res.sendStatus(401)
res.sendStatus(401)
}
} catch (err) {
throw err
} }
} }