fix: make discounts pass eslint

This commit is contained in:
Ronaldo Caetano
2021-10-25 22:06:46 -03:00
parent a1e446c121
commit 3df2b4279f
14 changed files with 109 additions and 193 deletions
@@ -20,17 +20,12 @@
*/
export default async (req, res) => {
const { discount_id, code } = req.params
const discountService = req.scope.resolve("discountService")
await discountService.deleteDynamicCode(discount_id, code)
try {
const discountService = req.scope.resolve("discountService")
await discountService.deleteDynamicCode(discount_id, code)
const discount = await discountService.retrieve(discount_id, {
relations: ["rule", "rule.valid_for", "regions"],
})
const discount = await discountService.retrieve(discount_id, {
relations: ["rule", "rule.valid_for", "regions"],
})
res.status(200).json({ discount })
} catch (err) {
throw err
}
res.status(200).json({ discount })
}