From 8bda0ee9235ee2c4cb7e68370ab47f4f417c9391 Mon Sep 17 00:00:00 2001 From: Jared Schoeny Date: Fri, 19 Dec 2025 23:40:34 -1000 Subject: [PATCH] Fix `publishPatchVersion` not updating `published` state --- src/app/hack/[slug]/actions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/hack/[slug]/actions.ts b/src/app/hack/[slug]/actions.ts index ba4baa0..eca96d2 100644 --- a/src/app/hack/[slug]/actions.ts +++ b/src/app/hack/[slug]/actions.ts @@ -525,8 +525,8 @@ export async function publishPatchVersion(slug: string, patchId: number): Promis // Check if this patch is newer than current_patch let willBecomeCurrent = false; + const serviceClient = await createServiceClient(); if (hack.current_patch) { - const serviceClient = await createServiceClient(); const { data: currentPatch } = await serviceClient .from("patches") .select("created_at") @@ -540,7 +540,7 @@ export async function publishPatchVersion(slug: string, patchId: number): Promis } // Publish the patch - const { error: updateErr } = await supabase + const { error: updateErr } = await serviceClient .from("patches") .update({ published: true, published_at: new Date().toISOString() }) .eq("id", patchId);