File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -72,8 +72,8 @@ const Customer: CollectionConfig = {
72
72
slug: ' customers' ,
73
73
hooks: {
74
74
afterChange: [
75
- async ({ doc }) => {
76
- await payload .update ({
75
+ async ({ doc , req }) => {
76
+ await req . payload .update ({
77
77
// DANGER: updating the same slug as the collection in an afterChange will create an infinite loop!
78
78
collection: ' customers' ,
79
79
id: doc .id ,
@@ -101,12 +101,12 @@ const MyCollection: CollectionConfig = {
101
101
slug: ' slug' ,
102
102
hooks: {
103
103
afterChange: [
104
- async ({ context , doc }) => {
104
+ async ({ context , doc , req }) => {
105
105
// return if flag was previously set
106
106
if (context .triggerAfterChange === false ) {
107
107
return
108
108
}
109
- await payload .update ({
109
+ await req . payload .update ({
110
110
collection: contextHooksSlug ,
111
111
id: doc .id ,
112
112
data: {
You can’t perform that action at this time.
0 commit comments