fix: pickup_code — 6-значное число вместо букв
This commit is contained in:
parent
5867272873
commit
9408b98f06
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue