fix: pickup_code — 6-значное число вместо букв

This commit is contained in:
root 2026-06-16 06:57:57 +00:00
parent 5867272873
commit 9408b98f06
3 changed files with 3 additions and 3 deletions

View File

@ -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 {

View File

@ -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;
}
}

View File

@ -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 {