fix: /api/routes/store/auth pass linting (#645)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { Validator, MedusaError } from "medusa-core-utils"
|
||||
|
||||
/**
|
||||
* @oas [get] /auth/{email}
|
||||
* operationId: "GetAuthEmail"
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user