From ecba44b98959a0bc55123045bceea0a58536af19 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 18 Aug 2025 15:56:23 +0100 Subject: [PATCH] fix: remove videos after posting --- server/api/publish-ama.post.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/api/publish-ama.post.ts b/server/api/publish-ama.post.ts index 69f8d283..439bd1d0 100644 --- a/server/api/publish-ama.post.ts +++ b/server/api/publish-ama.post.ts @@ -191,6 +191,16 @@ export default defineEventHandler(async event => { } }) + if (document.video) { + try { + await sanity.client.patch(document._id).unset(['video']).commit() + await sanity.client.delete(document.video.asset._ref) + } + catch (error) { + console.warn('Video cleanup failed (non-critical):', error) + } + } + const publishLog = results.map(result => ({ _type: 'object', _key: randomUUID(), -- knotmirror 0.0.1