Skip to content

fix: add draft, autosave, and trash args to collection and global hooks (#16180)#16192

Open
deepshekhardas wants to merge 2 commits intopayloadcms:mainfrom
deepshekhardas:fix/16180-hook-operation-args
Open

fix: add draft, autosave, and trash args to collection and global hooks (#16180)#16192
deepshekhardas wants to merge 2 commits intopayloadcms:mainfrom
deepshekhardas:fix/16180-hook-operation-args

Conversation

@deepshekhardas
Copy link
Copy Markdown
Contributor

Fixes #16180 - Operation args missing from collection and global hooks

Problem: Collection and global hooks (beforeValidate, beforeChange, afterChange, beforeRead, afterRead, beforeDelete, afterDelete) do not receive operation-level intent arguments like draft, autosave, or trash.

Solution: Added draft, autosave, and trash arguments to all relevant hook types and hook calls:

  • Collection hooks: beforeValidate, beforeChange, afterChange, beforeRead, afterRead, beforeDelete, afterDelete
  • Global hooks: beforeValidate, beforeChange, afterChange, beforeRead, afterRead
  • Updated all operation files: update.ts, create.ts, delete.ts, deleteByID.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Operation args missing from collection and global hooks

1 participant