Skip to content

Commit

Permalink
fix: 🐛 no lines early error
Browse files Browse the repository at this point in the history
  • Loading branch information
peelar committed Sep 6, 2023
1 parent e93efb1 commit 2d2a657
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 @@ -20,7 +20,7 @@ export type CalculateTaxesPayload = Extract<
>;

function verifyCalculateTaxesPayload(payload: CalculateTaxesPayload) {
if (!payload.taxBase.lines) {
if (!payload.taxBase.lines.length) {
throw new Error("No lines found in taxBase");
}

Expand Down
2 changes: 1 addition & 1 deletion apps/taxes/src/pages/api/webhooks/order-calculate-taxes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const config = {
type CalculateTaxesPayload = Extract<CalculateTaxesEventFragment, { __typename: "CalculateTaxes" }>;

function verifyCalculateTaxesPayload(payload: CalculateTaxesPayload) {
if (!payload.taxBase.lines) {
if (!payload.taxBase.lines.length) {
throw new Error("No lines found in taxBase");
}

Expand Down

0 comments on commit 2d2a657

Please sign in to comment.