chore(plugin-cloud): remove req refs, UNTESTED

This commit is contained in:
Elliot DeNolf
2024-02-29 12:14:41 -05:00
parent a66d023f84
commit 4699a37b4b
2 changed files with 12 additions and 5 deletions

View File

@@ -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 })
}

View File

@@ -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,
})