added tests to remaining components

This commit is contained in:
--list
2021-06-10 13:14:42 +02:00
parent 5b65345af1
commit bd6d0c6130
8 changed files with 39 additions and 24 deletions
@@ -27,6 +27,7 @@ export default async (req, res) => {
items: Validator.array().optional(),
})
.required(),
no_notification: Validator.boolean().optional(),
metadata: Validator.object().optional(),
})
@@ -25,6 +25,9 @@ import { defaultRelations, defaultFields } from "./"
* note:
* description: A not with additional details about the Refund.
* type: string
* no_notification:
* description: If set to true no notification will be send related to this Swap.
* type: boolean
* tags:
* - Order
* responses:
@@ -47,6 +50,7 @@ export default async (req, res) => {
note: Validator.string()
.allow("")
.optional(),
no_notification: Validator.boolean().optional(),
})
const { value, error } = schema.validate(req.body)
@@ -57,7 +61,7 @@ export default async (req, res) => {
try {
const orderService = req.scope.resolve("orderService")
await orderService.createRefund(id, value.amount, value.reason, value.note)
await orderService.createRefund(id, value.amount, value.reason, value.note, value.no_notification)
const order = await orderService.retrieve(id, {
select: defaultFields,
@@ -22,7 +22,8 @@ export default async (req, res) => {
price: Validator.number(),
data: Validator.object(),
items: Validator.array(),
})
}),
no_notification: Validator.boolean(),
})
const { value, error } = schema.validate(req.body)