Skip to content

Commit

Permalink
feat: update response rejection message (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlbrugger authored Sep 18, 2023
1 parent 7f9e6d7 commit 3fbf53a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
6 changes: 6 additions & 0 deletions .changeset/brave-files-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@flatfile/util-response-rejection': patch
'@flatfile/plugin-webhook-egress': patch
---

Update response rejection message
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions plugins/webhook-egress/src/webhook.egress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ export function webhookEgress(job: string, webhookUrl?: string) {
next: {
type: 'id',
id: rejections.id,
label: 'See rejections...',
label: 'See rejections',
},
message: `Data was submission was partially successful. ${totalRejectedRecords} record(s) were rejected.`,
message: `${totalRejectedRecords} record(s) were rejected during data submission. Review the rejection notes, fix, then resubmit.`,
},
}
}
Expand Down
4 changes: 2 additions & 2 deletions utils/response-rejection/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ export interface ResponseRejectionRecord {
}

export async function responseRejectionHandler(
partialRejection: ResponseRejection
responseRejection: ResponseRejection
): Promise<number> {
let totalRejectedRecords = 0

const results = await Promise.all(
partialRejection.sheets.map((sheet) => updateSheet(sheet))
responseRejection.sheets.map((sheet) => updateSheet(sheet))
)
totalRejectedRecords = results.reduce((acc, val) => acc + val, 0)

Expand Down

0 comments on commit 3fbf53a

Please sign in to comment.