Skip to content

Commit 6114008

Browse files
committed
feat(plugin-search): pass collection slug to beforeSync hook
1 parent ac1e3cf commit 6114008

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

packages/plugin-search/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export type BeforeSync = (args: {
2525
payload: Payload
2626
req: PayloadRequest
2727
searchDoc: DocToSync
28+
collection: string
2829
}) => DocToSync | Promise<DocToSync>
2930

3031
export type FieldsOverride = (args: { defaultFields: Field[] }) => Field[]

packages/plugin-search/src/utilities/syncDocAsSearchIndex.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const syncDocAsSearchIndex = async ({
4040
payload,
4141
req,
4242
searchDoc: dataToSave,
43+
collection,
4344
})
4445
}
4546

0 commit comments

Comments
 (0)