I have this api route I want to hit after like a new item is made in a collection.. is there a way to fetch certain api routes after a item in a collection is made, edited or deleted?
you can user afterOperation hook it has operation in argument "create update delete"
hi
@890486507872342027this is a perfect time to learn about hooks! Hooks are a powerful part of Payload that can be used at the config, collection, global, and field level -
https://payloadcms.com/docs/hooks/overviewYour best bet it to use either an afterOperation an afterChange hook -
https://payloadcms.com/docs/hooks/collections#afteroperationStar
Discord
online
Get dedicated engineering support directly from the Payload team.