mirror of
https://github.com/Hackdex-App/hackdex-website.git
synced 2026-08-24 09:34:41 -05:00
Fix publishPatchVersion not updating published state
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user