From 9408b98f0686e1222101eb308f7d308135bf0e56 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 16 Jun 2026 06:57:57 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20pickup=5Fcode=20=E2=80=94=206-=D0=B7?= =?UTF-8?q?=D0=BD=D0=B0=D1=87=D0=BD=D0=BE=D0=B5=20=D1=87=D0=B8=D1=81=D0=BB?= =?UTF-8?q?=D0=BE=20=D0=B2=D0=BC=D0=B5=D1=81=D1=82=D0=BE=20=D0=B1=D1=83?= =?UTF-8?q?=D0=BA=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/supabase/orderGroupRepository.js | 2 +- supabase/functions/confirm-delivery-choice/index.ts | 2 +- supabase/functions/update-order-group-delivery-choice/index.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/supabase/orderGroupRepository.js b/src/services/supabase/orderGroupRepository.js index c929fb7..81d4359 100644 --- a/src/services/supabase/orderGroupRepository.js +++ b/src/services/supabase/orderGroupRepository.js @@ -300,7 +300,7 @@ export const updateOrderGroupDeliveryChoice = async ({ .eq("id", orderGroupId) .single(); if (!existing?.pickup_code) { - const code = Math.random().toString(36).substring(2, 8).toUpperCase(); + const code = String(100000 + Math.floor(Math.random() * 900000)); updatePayload.pickup_code = code; } } else { diff --git a/supabase/functions/confirm-delivery-choice/index.ts b/supabase/functions/confirm-delivery-choice/index.ts index 9433766..b8895d4 100644 --- a/supabase/functions/confirm-delivery-choice/index.ts +++ b/supabase/functions/confirm-delivery-choice/index.ts @@ -217,7 +217,7 @@ Deno.serve(async (request) => { .eq("id", invitation.order_group_id) .single(); if (!existingGroup?.pickup_code) { - const code = Math.random().toString(36).substring(2, 8).toUpperCase(); + const code = String(100000 + Math.floor(Math.random() * 900000)); groupUpdateData.pickup_code = code; } } diff --git a/supabase/functions/update-order-group-delivery-choice/index.ts b/supabase/functions/update-order-group-delivery-choice/index.ts index 5671f38..6271dca 100644 --- a/supabase/functions/update-order-group-delivery-choice/index.ts +++ b/supabase/functions/update-order-group-delivery-choice/index.ts @@ -177,7 +177,7 @@ Deno.serve(async (request) => { updateData.assigned_driver_id = null; // Generate pickup code if not already set if (!currentGroup.pickup_code) { - const code = Math.random().toString(36).substring(2, 8).toUpperCase(); + const code = String(100000 + Math.floor(Math.random() * 900000)); updateData.pickup_code = code; } } else {