chore: threads through req so transactions are able to function accordingly
This commit is contained in:
@@ -64,6 +64,7 @@ async function deleteLocal<TSlug extends keyof GeneratedTypes['collections']>(
|
||||
fallbackLocale = null,
|
||||
locale = null,
|
||||
overrideAccess = true,
|
||||
req: incomingReq,
|
||||
showHiddenFields,
|
||||
user,
|
||||
where,
|
||||
@@ -86,6 +87,7 @@ async function deleteLocal<TSlug extends keyof GeneratedTypes['collections']>(
|
||||
locale: locale ?? defaultLocale,
|
||||
payload,
|
||||
payloadAPI: 'local',
|
||||
transactionID: incomingReq.transactionID,
|
||||
user,
|
||||
} as PayloadRequest
|
||||
setRequestContext(req, context)
|
||||
|
||||
@@ -80,6 +80,7 @@ async function updateLocal<TSlug extends keyof GeneratedTypes['collections']>(
|
||||
locale = null,
|
||||
overrideAccess = true,
|
||||
overwriteExistingFiles = false,
|
||||
req: incomingReq,
|
||||
showHiddenFields,
|
||||
user,
|
||||
where,
|
||||
@@ -106,6 +107,7 @@ async function updateLocal<TSlug extends keyof GeneratedTypes['collections']>(
|
||||
locale: locale ?? defaultLocale,
|
||||
payload,
|
||||
payloadAPI: 'local',
|
||||
transactionID: incomingReq?.transactionID,
|
||||
user,
|
||||
} as PayloadRequest
|
||||
setRequestContext(req, context)
|
||||
|
||||
@@ -56,6 +56,7 @@ const ContextHooks: CollectionConfig = {
|
||||
data: {
|
||||
value: context.secretValue ?? '',
|
||||
},
|
||||
req,
|
||||
context: {
|
||||
triggerAfterChange: false, // Make sure we don't trigger afterChange again and again in an infinite loop. This should be done via context and not a potential disableHooks property, as we want to specifically test the context functionality here
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user