Skip to content

Commit

Permalink
Mark the event as non optional for BulkRecordHook (#727)
Browse files Browse the repository at this point in the history
* Mark the event as non optional

* remove optional prop operator

* Update changeset

---------

Co-authored-by: Carl Brugger <carl.brugger@flatfile.io>
  • Loading branch information
marcus-ff and carlbrugger authored Jan 10, 2025
1 parent fdcd53e commit 762ff77
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/five-carrots-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@flatfile/plugin-record-hook': major
---

Mark the event as non optional BulkRecordHook
7 changes: 2 additions & 5 deletions plugins/record-hook/src/RecordHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ export interface RecordHookOptions {

export const RecordHook = async (
event: FlatfileEvent,
handler: (
record: FlatfileRecord,
event?: FlatfileEvent
) => any | Promise<any>,
handler: (record: FlatfileRecord, event: FlatfileEvent) => any | Promise<any>,
options: RecordHookOptions = {}
) => {
const { concurrency = 10 } = options
Expand Down Expand Up @@ -58,7 +55,7 @@ export const BulkRecordHook = async (
event: FlatfileEvent,
handler: (
records: FlatfileRecord[],
event?: FlatfileEvent
event: FlatfileEvent
) => any | Promise<any>,
options: BulkRecordHookOptions = {}
) => {
Expand Down
4 changes: 2 additions & 2 deletions plugins/record-hook/src/record.hook.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const recordHookPlugin = (
sheetSlug: string,
callback: (
record: FlatfileRecord,
event?: FlatfileEvent
event: FlatfileEvent
) => any | Promise<any>,
options: RecordHookOptions = {}
) => {
Expand All @@ -22,7 +22,7 @@ export const bulkRecordHookPlugin = (
sheetSlug: string,
callback: (
records: FlatfileRecord[],
event?: FlatfileEvent
event: FlatfileEvent
) => any | Promise<any>,
options: BulkRecordHookOptions = {}
) => {
Expand Down

0 comments on commit 762ff77

Please sign in to comment.