docs: fixture improvements + small fixes (#204)
* fix: deref arrays * docs: clean up * fix: update license
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
testEnvironment: "node",
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import _ from "lodash"
|
||||
import jwt from "jsonwebtoken"
|
||||
import { Validator } from "medusa-core-utils"
|
||||
import config from "../../../../config"
|
||||
@@ -19,7 +20,7 @@ import config from "../../../../config"
|
||||
* application/json:
|
||||
* schema:
|
||||
* properties:
|
||||
* customer:
|
||||
* user:
|
||||
* $ref: "#/components/schemas/user"
|
||||
*/
|
||||
export default async (req, res) => {
|
||||
@@ -46,5 +47,7 @@ export default async (req, res) => {
|
||||
expiresIn: "24h",
|
||||
})
|
||||
|
||||
res.json({ user: result.user })
|
||||
const cleanRes = _.omit(result.user, ["password_hash"])
|
||||
|
||||
res.json({ user: cleanRes })
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import passport from "passport"
|
||||
import _ from "lodash"
|
||||
|
||||
/**
|
||||
* @oas [get] /auth
|
||||
@@ -14,11 +14,13 @@ import passport from "passport"
|
||||
* application/json:
|
||||
* schema:
|
||||
* properties:
|
||||
* customer:
|
||||
* user:
|
||||
* $ref: "#/components/schemas/user"
|
||||
*/
|
||||
export default async (req, res) => {
|
||||
const userService = req.scope.resolve("userService")
|
||||
const user = await userService.retrieve(req.user.userId)
|
||||
res.status(200).json({ user })
|
||||
|
||||
const cleanRes = _.omit(user, ["password_hash"])
|
||||
res.status(200).json({ user: cleanRes })
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { defaultFields, defaultRelations } from "./"
|
||||
* summary: "Create a Swap"
|
||||
* description: "Creates a Swap. Swaps are used to handle Return of previously purchased goods and Fulfillment of replacements simultaneously."
|
||||
* parameters:
|
||||
* - (path) id=* {string} The id of the Swap.
|
||||
* - (path) id=* {string} The id of the Order.
|
||||
* requestBody:
|
||||
* content:
|
||||
* application/json:
|
||||
|
||||
@@ -5,7 +5,7 @@ import { defaultRelations, defaultFields } from "./"
|
||||
* @oas [get] /orders
|
||||
* operationId: "GetOrders"
|
||||
* summary: "List Orders"
|
||||
* description: "Retrieves an list of Orders"
|
||||
* description: "Retrieves a list of Orders"
|
||||
* tags:
|
||||
* - Order
|
||||
* responses:
|
||||
@@ -15,8 +15,10 @@ import { defaultRelations, defaultFields } from "./"
|
||||
* application/json:
|
||||
* schema:
|
||||
* properties:
|
||||
* order:
|
||||
* $ref: "#/components/schemas/order"
|
||||
* orders:
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: "#/components/schemas/order"
|
||||
*/
|
||||
|
||||
export default async (req, res) => {
|
||||
|
||||
Reference in New Issue
Block a user