Skip to content

Commit

Permalink
feat: update promotion error message
Browse files Browse the repository at this point in the history
Signed-off-by: vanpho93 <vanpho02@gmail.com>
  • Loading branch information
vanpho93 committed Feb 6, 2023
1 parent 366a11a commit 729b4a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default async function updateStandardCoupon(context, input) {

const now = new Date();
if (promotion.startDate <= now) {
throw new ReactionError("invalid-params", "This coupon cannot be edited because the promotion is on the window time");
throw new ReactionError("invalid-params", "Cannot update a coupon for a promotion that has already started");
}

if (input.code && coupon.code !== input.code) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ test("throws error when the related promotion is in promotion window", async ()
try {
await updateStandardCoupon(mockContext, input);
} catch (error) {
expect(error.message).toEqual("This coupon cannot be edited because the promotion is on the window time");
expect(error.message).toEqual("Cannot update a coupon for a promotion that has already started");
}
});

Expand Down

0 comments on commit 729b4a5

Please sign in to comment.