Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
🐛 Fix coupon validation
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed May 2, 2020
1 parent e610bec commit 43fcac1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/controllers/admin/coupons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ export class AdminCouponController {
@Middleware(
validator(
{
code: Joi.string(),
teamRestrictions: Joi.string(),
amount: Joi.number().required(),
currency: Joi.string().min(3).max(3).required(),
description: Joi.string(),
jwt: Joi.boolean(),
expiresAt: Joi.any(),
maxUses: Joi.number(),
},
"body"
)
Expand All @@ -60,9 +64,13 @@ export class AdminCouponController {
@Middleware(
validator(
{
code: Joi.string(),
amount: Joi.number(),
currency: Joi.string().min(3).max(3),
description: Joi.string().allow(null),
expiresAt: Joi.any().allow(null),
teamRestrictions: Joi.string().allow(null),
maxUses: Joi.number().allow(null),
jwt: Joi.boolean(),
},
"body"
Expand Down

0 comments on commit 43fcac1

Please sign in to comment.