chore(plugin-cloud): remove req refs, UNTESTED
This commit is contained in:
@@ -13,8 +13,10 @@ export const getCacheUploadsAfterChangeHook =
|
||||
async ({ doc, operation, req }) => {
|
||||
if (!req || !process.env.PAYLOAD_CLOUD_CACHE_KEY) return doc
|
||||
|
||||
const { res } = req
|
||||
if (res) {
|
||||
// WARNING:
|
||||
// TODO: Test this for 3.0
|
||||
const { payloadAPI } = req
|
||||
if (payloadAPI !== 'local') {
|
||||
if (operation === 'update') {
|
||||
// Unawaited promise
|
||||
void purge({ doc, endpoint, operation, req })
|
||||
@@ -28,8 +30,11 @@ export const getCacheUploadsAfterDeleteHook =
|
||||
async ({ doc, req }) => {
|
||||
if (!req || !process.env.PAYLOAD_CLOUD_CACHE_KEY) return doc
|
||||
|
||||
const { res } = req
|
||||
if (res) {
|
||||
const { payloadAPI } = req
|
||||
|
||||
// WARNING:
|
||||
// TODO: Test this for 3.0
|
||||
if (payloadAPI !== 'local') {
|
||||
// Unawaited promise
|
||||
void purge({ doc, endpoint, operation: 'delete', req })
|
||||
}
|
||||
|
||||
@@ -34,7 +34,9 @@ export const getStaticHandler = ({ cachingOptions, collection }: Args): StaticHa
|
||||
|
||||
const Key = createKey({
|
||||
collection: collection.slug,
|
||||
filename: req.params.filename,
|
||||
// WARNING:
|
||||
// TODO: Untested for 3.0
|
||||
filename: req.file.name,
|
||||
identityID,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user