diff --git a/node_modules/emdash/src/astro/routes/api/content/[collection]/[id].ts b/node_modules/emdash/src/astro/routes/api/content/[collection]/[id].ts index 305934b..bbec25b 100644 --- a/node_modules/emdash/src/astro/routes/api/content/[collection]/[id].ts +++ b/node_modules/emdash/src/astro/routes/api/content/[collection]/[id].ts @@ -85,7 +85,7 @@ export const PUT: APIRoute = async ({ params, request, locals, cache }) => { if (!result.success) return unwrapResult(result); - if (cache.enabled) await cache.invalidate({ tags: [collection, resolvedId] }); + if (cache?.enabled) await cache.invalidate({ tags: [collection, resolvedId] }); return unwrapResult(result); }; @@ -131,7 +131,7 @@ export const DELETE: APIRoute = async ({ params, locals, cache }) => { if (!result.success) return unwrapResult(result); - if (cache.enabled) await cache.invalidate({ tags: [collection, resolvedId] }); + if (cache?.enabled) await cache.invalidate({ tags: [collection, resolvedId] }); return unwrapResult(result); }; diff --git a/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts b/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts index 3044d39..77e2c86 100644 --- a/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +++ b/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts @@ -48,7 +48,7 @@ export const POST: APIRoute = async ({ params, locals, cache }) => { if (!result.success) return unwrapResult(result); - if (cache.enabled) await cache.invalidate({ tags: [collection, id] }); + if (cache?.enabled) await cache.invalidate({ tags: [collection, id] }); return unwrapResult(result); }; diff --git a/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/duplicate.ts b/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/duplicate.ts index 546bdf6..d5107fc 100644 --- a/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/duplicate.ts +++ b/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/duplicate.ts @@ -55,7 +55,7 @@ export const POST: APIRoute = async ({ params, locals, cache }) => { if (!result.success) return unwrapResult(result); - if (cache.enabled) await cache.invalidate({ tags: [collection] }); + if (cache?.enabled) await cache.invalidate({ tags: [collection] }); return unwrapResult(result, 201); }; diff --git a/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/permanent.ts b/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/permanent.ts index b4bb72f..e919fe5 100644 --- a/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/permanent.ts +++ b/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/permanent.ts @@ -27,7 +27,7 @@ export const DELETE: APIRoute = async ({ params, locals, cache }) => { if (!result.success) return unwrapResult(result); - if (cache.enabled) await cache.invalidate({ tags: [collection, id] }); + if (cache?.enabled) await cache.invalidate({ tags: [collection, id] }); return unwrapResult(result); }; diff --git a/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/publish.ts b/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/publish.ts index e203608..1a9e024 100644 --- a/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/publish.ts +++ b/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/publish.ts @@ -50,7 +50,7 @@ export const POST: APIRoute = async ({ params, locals, cache }) => { if (!result.success) return unwrapResult(result); - if (cache.enabled) await cache.invalidate({ tags: [collection, resolvedId] }); + if (cache?.enabled) await cache.invalidate({ tags: [collection, resolvedId] }); return unwrapResult(result); }; diff --git a/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/restore.ts b/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/restore.ts index dd3bc91..770582e 100644 --- a/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/restore.ts +++ b/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/restore.ts @@ -48,7 +48,7 @@ export const POST: APIRoute = async ({ params, locals, cache }) => { if (!result.success) return unwrapResult(result); - if (cache.enabled) await cache.invalidate({ tags: [collection, id] }); + if (cache?.enabled) await cache.invalidate({ tags: [collection, id] }); return unwrapResult(result); }; diff --git a/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/schedule.ts b/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/schedule.ts index 9bdc6a4..67f2cae 100644 --- a/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/schedule.ts +++ b/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/schedule.ts @@ -63,7 +63,7 @@ export const POST: APIRoute = async ({ params, request, locals, cache }) => { if (!result.success) return unwrapResult(result); - if (cache.enabled) await cache.invalidate({ tags: [collection, resolvedId ?? id] }); + if (cache?.enabled) await cache.invalidate({ tags: [collection, resolvedId ?? id] }); return unwrapResult(result); }; @@ -95,7 +95,7 @@ export const DELETE: APIRoute = async ({ params, locals, cache }) => { if (!result.success) return unwrapResult(result); - if (cache.enabled) await cache.invalidate({ tags: [collection, resolvedId ?? id] }); + if (cache?.enabled) await cache.invalidate({ tags: [collection, resolvedId ?? id] }); return unwrapResult(result); }; diff --git a/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/unpublish.ts b/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/unpublish.ts index 8034759..29e6ee1 100644 --- a/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/unpublish.ts +++ b/node_modules/emdash/src/astro/routes/api/content/[collection]/[id]/unpublish.ts @@ -50,7 +50,7 @@ export const POST: APIRoute = async ({ params, locals, cache }) => { if (!result.success) return unwrapResult(result); - if (cache.enabled) await cache.invalidate({ tags: [collection, resolvedId] }); + if (cache?.enabled) await cache.invalidate({ tags: [collection, resolvedId] }); return unwrapResult(result); }; diff --git a/node_modules/emdash/src/astro/routes/api/content/[collection]/index.ts b/node_modules/emdash/src/astro/routes/api/content/[collection]/index.ts index 1ebf36a..d009d88 100644 --- a/node_modules/emdash/src/astro/routes/api/content/[collection]/index.ts +++ b/node_modules/emdash/src/astro/routes/api/content/[collection]/index.ts @@ -53,7 +53,7 @@ export const POST: APIRoute = async ({ params, request, locals, cache }) => { if (!result.success) return unwrapResult(result); - if (cache.enabled) await cache.invalidate({ tags: [collection] }); + if (cache?.enabled) await cache.invalidate({ tags: [collection] }); return unwrapResult(result, 201); };